1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 10:47:28 +08:00

Merge pull request #1602 from smoogipoo/fix-mania-conversion

Fix possible invalid cast when generating mania patterns
This commit is contained in:
Dean Herbert 2017-11-27 18:47:13 +09:00 committed by GitHub
commit 5947af13b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,8 +138,8 @@ namespace osu.Game.Rulesets.Mania.Beatmaps
Pattern newPattern = conversion.Generate(); Pattern newPattern = conversion.Generate();
lastPattern = newPattern; lastPattern = newPattern;
var stairPatternGenerator = (HitObjectPatternGenerator)conversion; var stairPatternGenerator = conversion as HitObjectPatternGenerator;
lastStair = stairPatternGenerator.StairType; lastStair = stairPatternGenerator?.StairType ?? lastStair;
return newPattern.HitObjects; return newPattern.HitObjects;
} }