Fix incorrect slider stacking on very old beatmaps

Closes https://github.com/ppy/osu/issues/24185

The stable code has had a bug in this logic forever. So we'll need to
reimplement the bug.

Basically, sliders have to have `UpdateCalculations` run in order to
have a correct `Position2` and `EndTime`, but this wasn't being called
in the inner loop before use of `EndTime` at
1531237b63/osu!/GameplayElements/HitObjectManager.cs#L1813.

To fix this, we use `StartTime` in the inner loop to reproduce the bug.
This commit is contained in:
Dean Herbert 2023-07-12 17:23:31 +09:00
parent 8e1e8a2807
commit 87570ed238
1 changed files with 9 additions and 2 deletions

View File

@ -214,17 +214,24 @@ private void applyStackingOld(Beatmap<OsuHitObject> beatmap)
? currSlider.Position + currSlider.Path.PositionAt(1)
: currHitObject.Position;
// Note the use of `StartTime` in the code below doesn't match stable's use of `EndTime`.
// This is because in the stable implementation, `UpdateCalculations` is not called on the inner-loop hitobject (j)
// and therefore it does not have a correct `EndTime`, but instead the default of `EndTime = StartTime`.
//
// Effects of this can be seen on https://osu.ppy.sh/beatmapsets/243#osu/1146 at sliders around 86647 ms, where
// if we use `EndTime` here it would result in unexpected stacking.
if (Vector2Extensions.Distance(beatmap.HitObjects[j].Position, currHitObject.Position) < stack_distance)
{
currHitObject.StackHeight++;
startTime = beatmap.HitObjects[j].GetEndTime();
startTime = beatmap.HitObjects[j].StartTime;
}
else if (Vector2Extensions.Distance(beatmap.HitObjects[j].Position, position2) < stack_distance)
{
// Case for sliders - bump notes down and right, rather than up and left.
sliderStack++;
beatmap.HitObjects[j].StackHeight -= sliderStack;
startTime = beatmap.HitObjects[j].GetEndTime();
startTime = beatmap.HitObjects[j].StartTime;
}
}
}