ECS airlocks (#13500)

This commit is contained in:
metalgearsloth
2023-01-18 05:44:32 +11:00
committed by GitHub
parent 8550baa218
commit 2873a830bd
19 changed files with 270 additions and 291 deletions

View File

@@ -8,6 +8,9 @@ public static class StaticPowerSystem
// ReSharper disable once UnusedParameter.Global
public static bool IsPowered(this EntitySystem system, EntityUid uid, IEntityManager entManager, ApcPowerReceiverComponent? receiver = null)
{
return entManager.TryGetComponent<ApcPowerReceiverComponent>(uid, out receiver) && receiver.Powered;
if (receiver == null && !entManager.TryGetComponent(uid, out receiver))
return false;
return receiver.Powered;
}
}