Files
tbd-station-14/Content.Client/Power/EntitySystems/StaticPowerSystem.cs
Tayrtahn c60910dfa6 Fix devices in terminal mispredicting power state (#38647)
* The simple solution

* The better solution

* Revert "The better solution"

This reverts commit 611e56e031636734abab1ad3e77bf88b69a4de13.
2025-07-14 00:49:27 -07:00

17 lines
520 B
C#

using Content.Client.Power.Components;
namespace Content.Client.Power.EntitySystems;
public static class StaticPowerSystem
{
// Using this makes the call shorter.
// ReSharper disable once UnusedParameter.Global
public static bool IsPowered(this EntitySystem system, EntityUid uid, IEntityManager entManager, ApcPowerReceiverComponent? receiver = null)
{
if (receiver == null && !entManager.TryGetComponent(uid, out receiver))
return true;
return receiver.Powered;
}
}