diff --git a/Content.Client/Cargo/Systems/CargoSystem.Telepad.cs b/Content.Client/Cargo/Systems/CargoSystem.Telepad.cs index 50d079737d..312c4e8019 100644 --- a/Content.Client/Cargo/Systems/CargoSystem.Telepad.cs +++ b/Content.Client/Cargo/Systems/CargoSystem.Telepad.cs @@ -67,8 +67,10 @@ public sealed partial class CargoSystem if (!Resolve(uid, ref sprite)) return; + if (!TryComp(uid, out var player)) + return; + _appearance.TryGetData(uid, CargoTelepadVisuals.State, out var state); - AnimationPlayerComponent? player = null; switch (state) { @@ -76,7 +78,7 @@ public sealed partial class CargoSystem if (_player.HasRunningAnimation(uid, TelepadBeamKey)) return; _player.Stop(uid, player, TelepadIdleKey); - _player.Play(uid, player, CargoTelepadBeamAnimation, TelepadBeamKey); + _player.Play((uid, player), CargoTelepadBeamAnimation, TelepadBeamKey); break; case CargoTelepadState.Unpowered: sprite.LayerSetVisible(CargoTelepadLayers.Beam, false); @@ -90,7 +92,7 @@ public sealed partial class CargoSystem _player.HasRunningAnimation(uid, player, TelepadBeamKey)) return; - _player.Play(uid, player, CargoTelepadIdleAnimation, TelepadIdleKey); + _player.Play((uid, player), CargoTelepadIdleAnimation, TelepadIdleKey); break; } } diff --git a/Resources/Prototypes/Entities/Structures/cargo_telepad.yml b/Resources/Prototypes/Entities/Structures/cargo_telepad.yml index a99f35a7d9..a3198b58ea 100644 --- a/Resources/Prototypes/Entities/Structures/cargo_telepad.yml +++ b/Resources/Prototypes/Entities/Structures/cargo_telepad.yml @@ -1,4 +1,4 @@ -- type: entity +- type: entity id: CargoTelepad parent: [ BaseMachinePowered, ConstructibleMachine ] name: cargo telepad @@ -49,3 +49,4 @@ - type: CollideOnAnchor - type: NameIdentifier group: CargoTelepads + - type: AnimationPlayer