Make paused poweredlights enabled (#14270)

This commit is contained in:
metalgearsloth
2023-05-03 00:57:48 +10:00
committed by GitHub
parent 662628d0f9
commit 47edb3cd7f
3 changed files with 15 additions and 1 deletions

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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: