1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 09:27:29 +08:00

Merge pull request #24188 from peppy/fix-legacy-old-stacking-wang

Fix incorrect slider stacking on very old beatmaps
This commit is contained in:
Bartłomiej Dach 2023-07-12 23:51:00 +02:00 committed by GitHub
commit a891dcd9e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -214,17 +214,24 @@ namespace osu.Game.Rulesets.Osu.Beatmaps
? currSlider.Position + currSlider.Path.PositionAt(1) ? currSlider.Position + currSlider.Path.PositionAt(1)
: currHitObject.Position; : 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) if (Vector2Extensions.Distance(beatmap.HitObjects[j].Position, currHitObject.Position) < stack_distance)
{ {
currHitObject.StackHeight++; currHitObject.StackHeight++;
startTime = beatmap.HitObjects[j].GetEndTime(); startTime = beatmap.HitObjects[j].StartTime;
} }
else if (Vector2Extensions.Distance(beatmap.HitObjects[j].Position, position2) < stack_distance) else if (Vector2Extensions.Distance(beatmap.HitObjects[j].Position, position2) < stack_distance)
{ {
// Case for sliders - bump notes down and right, rather than up and left. // Case for sliders - bump notes down and right, rather than up and left.
sliderStack++; sliderStack++;
beatmap.HitObjects[j].StackHeight -= sliderStack; beatmap.HitObjects[j].StackHeight -= sliderStack;
startTime = beatmap.HitObjects[j].GetEndTime(); startTime = beatmap.HitObjects[j].StartTime;
} }
} }
} }