From 9398f90e7cf903043ef8fbe43b8b35daf9dea7fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Aguilera=20Puerto?= Date: Tue, 1 Sep 2020 16:18:46 +0200 Subject: [PATCH] Lights now use dependencies. --- .../PowerReceiverUsers/PoweredLightComponent.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/PoweredLightComponent.cs b/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/PoweredLightComponent.cs index 31cfdf5934..4ac42d949e 100644 --- a/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/PoweredLightComponent.cs +++ b/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/PoweredLightComponent.cs @@ -31,6 +31,8 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents.PowerRece [RegisterComponent] public class PoweredLightComponent : Component, IInteractHand, IInteractUsing, IMapInit, ISignalReceiver { + [Dependency] private IGameTiming _gameTiming = default!; + public override string Name => "PoweredLight"; private static readonly TimeSpan _thunkDelay = TimeSpan.FromSeconds(2); @@ -40,6 +42,7 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents.PowerRece private LightBulbType BulbType = LightBulbType.Tube; [ViewVariables] private ContainerSlot _lightBulbContainer; + [ViewVariables] private LightBulbComponent LightBulb { @@ -209,7 +212,7 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents.PowerRece sprite.LayerSetState(0, "on"); light.Enabled = true; light.Color = LightBulb.Color; - var time = IoCManager.Resolve().CurTime; + var time = _gameTiming.CurTime; if (time > _lastThunk + _thunkDelay) { _lastThunk = time;