Content/Light: make lights actually require power after changing the lightbulb (#4953)

This commit is contained in:
E F R
2021-10-22 06:46:22 +00:00
committed by GitHub
parent 5b531b7dcf
commit 85f2fcb86b

View File

@@ -219,11 +219,11 @@ namespace Content.Server.Light.Components
public void UpdateLight()
{
var powerReceiver = Owner.GetComponent<ApcPowerReceiverComponent>();
powerReceiver.Load = (LightBulb != null && _on && LightBulb.State == LightBulbState.Normal) ? LightBulb.PowerUse : 0;
if (LightBulb == null) // No light bulb.
{
SetLight(false);
powerReceiver.Load = 0;
_appearance?.SetData(PoweredLightVisuals.BulbState, PoweredLightState.Empty);
return;
}
@@ -234,7 +234,6 @@ namespace Content.Server.Light.Components
if (powerReceiver.Powered && _on)
{
SetLight(true, LightBulb.Color);
powerReceiver.Load = LightBulb.PowerUse;
_appearance?.SetData(PoweredLightVisuals.BulbState, PoweredLightState.On);
var time = _gameTiming.CurTime;
if (time > _lastThunk + _thunkDelay)