Fix possible invalid cast when generating mania patterns

This commit is contained in:
smoogipoo 2017-11-27 18:39:13 +09:00
parent 90e1f16645
commit 2c53be7853

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;
} }