fix(FaxVisualsSystem): Fax can Play() when a anim key has been added. (#30013)
Adds a check to see if a faxecute animation is being played before playing another animation. The old code can thrown an exception which I've seen on live while ghosting.
This commit is contained in:
@@ -25,9 +25,14 @@ public sealed class FaxVisualsSystem : EntitySystem
|
|||||||
if (args.Sprite == null)
|
if (args.Sprite == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_appearance.TryGetData(uid, FaxMachineVisuals.VisualState, out FaxMachineVisualState visuals) && visuals == FaxMachineVisualState.Inserting)
|
if (_player.HasRunningAnimation(uid, "faxecute"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (_appearance.TryGetData(uid, FaxMachineVisuals.VisualState, out FaxMachineVisualState visuals) &&
|
||||||
|
visuals == FaxMachineVisualState.Inserting)
|
||||||
{
|
{
|
||||||
_player.Play(uid, new Animation()
|
_player.Play(uid,
|
||||||
|
new Animation()
|
||||||
{
|
{
|
||||||
Length = TimeSpan.FromSeconds(2.4),
|
Length = TimeSpan.FromSeconds(2.4),
|
||||||
AnimationTracks =
|
AnimationTracks =
|
||||||
@@ -39,10 +44,11 @@ public sealed class FaxVisualsSystem : EntitySystem
|
|||||||
{
|
{
|
||||||
new AnimationTrackSpriteFlick.KeyFrame(component.InsertingState, 0f),
|
new AnimationTrackSpriteFlick.KeyFrame(component.InsertingState, 0f),
|
||||||
new AnimationTrackSpriteFlick.KeyFrame("icon", 2.4f),
|
new AnimationTrackSpriteFlick.KeyFrame("icon", 2.4f),
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}, "faxecute");
|
},
|
||||||
|
"faxecute");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user