Revert "Make lights dim under low power" (#19708)

This commit is contained in:
metalgearsloth
2023-09-01 09:47:30 +10:00
committed by GitHub
parent 3ab346f471
commit 279674c0b3
4 changed files with 3 additions and 35 deletions

View File

@@ -297,14 +297,13 @@ namespace Content.Server.Power.EntitySystems
while (enumerator.MoveNext(out var uid, out var apcReceiver))
{
var powered = apcReceiver.Powered;
if (apcReceiver.LastPowerReceived == apcReceiver.NetworkLoad.ReceivingPower)
if (powered == apcReceiver.PoweredLastUpdate)
continue;
if (metaQuery.GetComponent(uid).EntityPaused)
continue;
apcReceiver.PoweredLastUpdate = powered;
apcReceiver.LastPowerReceived = apcReceiver.NetworkLoad.ReceivingPower;
var ev = new PowerChangedEvent(apcReceiver.Powered, apcReceiver.NetworkLoad.ReceivingPower);
RaiseLocalEvent(apcReceiver.Owner, ref ev);

View File

@@ -156,25 +156,6 @@ namespace Content.Server.Power.EntitySystems
return receiver.Powered;
}
/// <summary>
/// Return the fraction of the load power that is actually supplied to this receiver, e.g. 1
/// if full power and 0 if no power. Better at handling brownouts compared to IsPowered().
/// Handles always-powered devices correctly.
/// </summary>
public float SupplyFactor(EntityUid uid, ApcPowerReceiverComponent? receiver = null)
{
if (!Resolve(uid, ref receiver, false))
return 1f;
if (receiver.PowerDisabled)
return 0f;
if (!receiver.NeedsPower)
return 1f;
return receiver.NetworkLoad.ReceivingPower / receiver.Load;
}
/// <summary>
/// Turn this machine on or off.
/// Returns true if we turned it on, false if we turned it off.