From: Niels Huylebroeck Date: Mon, 25 Nov 2024 12:35:14 +0000 (+0100) Subject: Turn off PointLights on VendingMachines when broken or off. (#33513) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=49724a9b9d48421f88d7785b972ed27ba01f4d89;p=space-station-14.git 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 --- diff --git a/Content.Server/VendingMachines/VendingMachineSystem.cs b/Content.Server/VendingMachines/VendingMachineSystem.cs index 90fe4cb7d8..c20a6a4644 100644 --- a/Content.Server/VendingMachines/VendingMachineSystem.cs +++ b/Content.Server/VendingMachines/VendingMachineSystem.cs @@ -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); }