mirror of
https://github.com/ppy/osu.git
synced 2025-03-19 07:47:19 +08:00
Merge pull request #10770 from cadon0/fix-storyboard-sprite-paths
Fix crashes if animation sprite path does not match a file
This commit is contained in:
commit
8788ef74aa
@ -115,11 +115,11 @@ namespace osu.Game.Storyboards.Drawables
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(TextureStore textureStore, Storyboard storyboard)
|
||||
{
|
||||
for (int frame = 0; frame < Animation.FrameCount; frame++)
|
||||
for (int frameIndex = 0; frameIndex < Animation.FrameCount; frameIndex++)
|
||||
{
|
||||
string framePath = Animation.Path.Replace(".", frame + ".");
|
||||
|
||||
AddFrame(storyboard.CreateSpriteFromResourcePath(framePath, textureStore), Animation.FrameDelay);
|
||||
string framePath = Animation.Path.Replace(".", frameIndex + ".");
|
||||
Drawable frame = storyboard.CreateSpriteFromResourcePath(framePath, textureStore) ?? Empty();
|
||||
AddFrame(frame, Animation.FrameDelay);
|
||||
}
|
||||
|
||||
Animation.ApplyTransforms(this);
|
||||
|
Loading…
x
Reference in New Issue
Block a user