From c53b5d422dd0bdcd5b0d1d8b8b27ff60f938273c Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Wed, 29 May 2024 10:34:46 +1000 Subject: [PATCH] Don't update APC states unless UI open (#27803) --- Content.Server/Power/EntitySystems/ApcSystem.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Server/Power/EntitySystems/ApcSystem.cs b/Content.Server/Power/EntitySystems/ApcSystem.cs index 529d4d81d7..d88edd85cb 100644 --- a/Content.Server/Power/EntitySystems/ApcSystem.cs +++ b/Content.Server/Power/EntitySystems/ApcSystem.cs @@ -45,7 +45,7 @@ public sealed class ApcSystem : EntitySystem var query = EntityQueryEnumerator(); while (query.MoveNext(out var uid, out var apc, out var battery, out var ui)) { - if (apc.LastUiUpdate + ApcComponent.VisualsChangeDelay < _gameTiming.CurTime) + if (apc.LastUiUpdate + ApcComponent.VisualsChangeDelay < _gameTiming.CurTime && _ui.IsUiOpen((uid, ui), ApcUiKey.Key)) { apc.LastUiUpdate = _gameTiming.CurTime; UpdateUIState(uid, apc, battery);