mirror of
https://github.com/space-wizards/space-station-14.git
synced 2026-02-15 03:31:30 +01:00
Vending machines properly show their current state after an animation (#12201)
This commit is contained in:
@@ -7,6 +7,7 @@ namespace Content.Client.VendingMachines;
|
||||
public sealed class VendingMachineSystem : SharedVendingMachineSystem
|
||||
{
|
||||
[Dependency] private readonly AnimationPlayerSystem _animationPlayer = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearanceSystem = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -21,7 +22,14 @@ public sealed class VendingMachineSystem : SharedVendingMachineSystem
|
||||
if (!TryComp<SpriteComponent>(uid, out var sprite))
|
||||
return;
|
||||
|
||||
UpdateAppearance(uid, VendingMachineVisualState.Normal, component, sprite);
|
||||
if (!TryComp<AppearanceComponent>(uid, out var appearance) ||
|
||||
!_appearanceSystem.TryGetData(uid, VendingMachineVisuals.VisualState, out var visualStateObject, appearance) ||
|
||||
visualStateObject is not VendingMachineVisualState visualState)
|
||||
{
|
||||
visualState = VendingMachineVisualState.Normal;
|
||||
}
|
||||
|
||||
UpdateAppearance(uid, visualState, component, sprite);
|
||||
}
|
||||
|
||||
private void OnAppearanceChange(EntityUid uid, VendingMachineComponent component, ref AppearanceChangeEvent args)
|
||||
|
||||
Reference in New Issue
Block a user