@@ -83,5 +83,18 @@ namespace Content.Server.Power.EntitySystems
|
||||
if (TryComp(receiver.Owner, out AppearanceComponent? appearance))
|
||||
appearance.SetData(PowerDeviceVisuals.Powered, receiver.Powered);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If this takes power, it returns whether it has power.
|
||||
/// Otherwise, it returns 'true' because if something doesn't take power
|
||||
/// it's effectively always powered.
|
||||
/// </summary>
|
||||
public bool IsPowered(EntityUid uid, ApcPowerReceiverComponent? receiver = null)
|
||||
{
|
||||
if (!Resolve(uid, ref receiver, false))
|
||||
return true;
|
||||
|
||||
return receiver.Powered;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user