Turn off PointLights on VendingMachines when broken or off. (#33513)
The light itself should already turn off due to `LitOnPowered` component, but the broken state of a VendingMachine did not. Fixes #33382
This commit is contained in:
committed by
GitHub
parent
ae576abe1f
commit
49724a9b9d
@@ -38,6 +38,7 @@ namespace Content.Server.VendingMachines
|
||||
[Dependency] private readonly ThrowingSystem _throwingSystem = default!;
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
[Dependency] private readonly SpeakOnUIClosedSystem _speakOnUIClosed = default!;
|
||||
[Dependency] private readonly SharedPointLightSystem _light = default!;
|
||||
|
||||
private const float WallVendEjectDistanceFromWall = 1f;
|
||||
|
||||
@@ -334,6 +335,12 @@ namespace Content.Server.VendingMachines
|
||||
finalState = VendingMachineVisualState.Off;
|
||||
}
|
||||
|
||||
if (_light.TryGetLight(uid, out var pointlight))
|
||||
{
|
||||
var lightState = finalState != VendingMachineVisualState.Broken && finalState != VendingMachineVisualState.Off;
|
||||
_light.SetEnabled(uid, lightState, pointlight);
|
||||
}
|
||||
|
||||
_appearanceSystem.SetData(uid, VendingMachineVisuals.VisualState, finalState);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user