mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-01 08:37:26 +00:00
* add disabling apc power with wire * update apc yml * make wire lights work for APC * show it as Disabled in the ui --------- Co-authored-by: deltanedas <@deltanedas:kde.org>
18 lines
492 B
C#
18 lines
492 B
C#
using Content.Server.Power.Components;
|
|
using Content.Server.Power.EntitySystems;
|
|
|
|
namespace Content.Server.Wires;
|
|
|
|
public sealed partial class WiresSystem
|
|
{
|
|
public bool HasPower(EntityUid uid)
|
|
{
|
|
// for APCs check if the power wire isn't snipped/pulsed
|
|
if (TryComp<PowerNetworkBatteryComponent>(uid, out var comp))
|
|
return comp.PowerEnabled;
|
|
|
|
// for other devices check for APCPowerReceiver
|
|
return this.IsPowered(uid, EntityManager);
|
|
}
|
|
}
|