Skip to content

Commit 8b04b75

Browse files
authored
Merge pull request #32192 from smoogipoo/more-beatmap-load-cancellations
Cancel beatmap load in more loops
2 parents c4e37a1 + 0339520 commit 8b04b75

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

osu.Game/Rulesets/Objects/HitObject.cs

+4
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ public IList<HitSampleInfo> Samples
104104
/// <param name="cancellationToken">The cancellation token.</param>
105105
public void ApplyDefaults(ControlPointInfo controlPointInfo, IBeatmapDifficultyInfo difficulty, CancellationToken cancellationToken = default)
106106
{
107+
cancellationToken.ThrowIfCancellationRequested();
108+
107109
ApplyDefaultsToSelf(controlPointInfo, difficulty);
108110

109111
nestedHitObjects.Clear();
@@ -114,6 +116,8 @@ public void ApplyDefaults(ControlPointInfo controlPointInfo, IBeatmapDifficultyI
114116
{
115117
foreach (HitObject hitObject in nestedHitObjects)
116118
{
119+
cancellationToken.ThrowIfCancellationRequested();
120+
117121
if (hitObject is IHasComboInformation n)
118122
{
119123
n.ComboIndexBindable.BindTo(hasCombo.ComboIndexBindable);

osu.Game/Rulesets/Objects/SliderEventGenerator.cs

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ public static IEnumerable<SliderEventDescriptor> Generate(double startTime, doub
4646

4747
for (int span = 0; span < spanCount; span++)
4848
{
49+
cancellationToken.ThrowIfCancellationRequested();
50+
4951
double spanStartTime = startTime + span * spanDuration;
5052
bool reversed = span % 2 == 1;
5153

0 commit comments

Comments
 (0)