mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 15:03:13 +08:00
Coerce undefined animation loop types to Forever
This commit is contained in:
parent
d7e5a21213
commit
b9a49d5589
@ -139,7 +139,7 @@ namespace osu.Game.Beatmaps.Formats
|
||||
// this is random as hell but taken straight from osu-stable.
|
||||
frameDelay = Math.Round(0.015 * frameDelay) * 1.186 * (1000 / 60f);
|
||||
|
||||
var loopType = split.Length > 8 ? (AnimationLoopType)Enum.Parse(typeof(AnimationLoopType), split[8]) : AnimationLoopType.LoopForever;
|
||||
var loopType = split.Length > 8 ? parseAnimationLoopType(split[8]) : AnimationLoopType.LoopForever;
|
||||
storyboardSprite = new StoryboardAnimation(path, origin, new Vector2(x, y), frameCount, frameDelay, loopType);
|
||||
storyboard.GetLayer(layer).Add(storyboardSprite);
|
||||
break;
|
||||
@ -341,6 +341,12 @@ namespace osu.Game.Beatmaps.Formats
|
||||
}
|
||||
}
|
||||
|
||||
private AnimationLoopType parseAnimationLoopType(string value)
|
||||
{
|
||||
var parsed = (AnimationLoopType)Enum.Parse(typeof(AnimationLoopType), value);
|
||||
return Enum.IsDefined(typeof(AnimationLoopType), parsed) ? parsed : AnimationLoopType.LoopForever;
|
||||
}
|
||||
|
||||
private void handleVariables(string line)
|
||||
{
|
||||
var pair = SplitKeyVal(line, '=');
|
||||
|
Loading…
Reference in New Issue
Block a user