From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Tue, 2 May 2023 14:57:48 +0000 (+1000) Subject: Make paused poweredlights enabled (#14270) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=47edb3cd7f8ac5cf290c599f0c526cd376ba5ea2;p=space-station-14.git Make paused poweredlights enabled (#14270) --- diff --git a/Content.Server/Light/EntitySystems/EmergencyLightSystem.cs b/Content.Server/Light/EntitySystems/EmergencyLightSystem.cs index de45b6c983..c18406564e 100644 --- a/Content.Server/Light/EntitySystems/EmergencyLightSystem.cs +++ b/Content.Server/Light/EntitySystems/EmergencyLightSystem.cs @@ -34,8 +34,14 @@ namespace Content.Server.Light.EntitySystems private void OnEmergencyPower(EntityUid uid, EmergencyLightComponent component, ref PowerChangedEvent args) { - if (MetaData(uid).EntityLifeStage >= EntityLifeStage.Terminating) + var meta = MetaData(uid); + + // TODO: PowerChangedEvent shouldn't be issued for paused ents but this is the world we live in. + if (meta.EntityLifeStage >= EntityLifeStage.Terminating || + meta.EntityPaused) + { return; + } UpdateState(component); } diff --git a/Content.Server/Light/EntitySystems/PoweredLightSystem.cs b/Content.Server/Light/EntitySystems/PoweredLightSystem.cs index 9cd0c06dc4..38632912a4 100644 --- a/Content.Server/Light/EntitySystems/PoweredLightSystem.cs +++ b/Content.Server/Light/EntitySystems/PoweredLightSystem.cs @@ -333,6 +333,10 @@ namespace Content.Server.Light.EntitySystems private void OnPowerChanged(EntityUid uid, PoweredLightComponent component, ref PowerChangedEvent args) { + // TODO: Power moment + if (MetaData(uid).EntityPaused) + return; + UpdateLight(uid, component); } diff --git a/Resources/Prototypes/Entities/Structures/Lighting/base_lighting.yml b/Resources/Prototypes/Entities/Structures/Lighting/base_lighting.yml index aecaff1526..9abf8eef60 100644 --- a/Resources/Prototypes/Entities/Structures/Lighting/base_lighting.yml +++ b/Resources/Prototypes/Entities/Structures/Lighting/base_lighting.yml @@ -107,6 +107,8 @@ components: - type: Sprite state: off + - type: PointLight + enabled: true - type: PoweredLight hasLampOnSpawn: LightTube damage: @@ -282,6 +284,8 @@ components: - type: Sprite state: off + - type: PointLight + enabled: true - type: PoweredLight hasLampOnSpawn: LightBulb damage: