1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-18 10:53:21 +08:00

Fix incorrect lastPattern value

In particular, mania-specific beatmaps that normally go via the
"passthrough" generator should not adjust the stored pattern value.

The "spinner" generator, which was previously intended to be used for
non-mania-specific beatmaps, is now valid even for mania-specific
beatmaps, and uses this value.

In other words, another way of writing this would be:
```csharp
if (conversion is SpinnerPatternGenerator || conversion is
PassThroughPatternGenerator) ? lastPattern : newPattern;
```
This commit is contained in:
Dan Balasescu 2024-12-13 16:08:12 +09:00
parent 12e5999700
commit d597232c2a
No known key found for this signature in database

View File

@ -220,8 +220,11 @@ namespace osu.Game.Rulesets.Mania.Beatmaps
foreach (var newPattern in conversion.Generate())
{
lastPattern = conversion is SpinnerPatternGenerator ? lastPattern : newPattern;
lastStair = (conversion as HitCirclePatternGenerator)?.StairType ?? lastStair;
if (conversion is HitCirclePatternGenerator circleGenerator)
lastStair = circleGenerator.StairType;
if (conversion is HitCirclePatternGenerator || conversion is SliderPatternGenerator)
lastPattern = newPattern;
foreach (var obj in newPattern.HitObjects)
yield return obj;