Fix instant power cell drainage (#15927)

This commit is contained in:
Nemanja
2023-04-30 02:06:44 -04:00
committed by GitHub
parent ff0efb89e3
commit bccad7d430
4 changed files with 17 additions and 18 deletions

View File

@@ -113,7 +113,7 @@ public sealed class ProximityBeeperSystem : EntitySystem
component.NextBeepTime = _timing.CurTime;
UpdateBeep(uid, component, false);
if (draw != null)
draw.Enabled = true;
_powerCell.SetPowerCellDrawEnabled(uid, true, draw);
return true;
}
@@ -130,8 +130,7 @@ public sealed class ProximityBeeperSystem : EntitySystem
component.Enabled = false;
_appearance.SetData(uid, ProximityBeeperVisuals.Enabled, false);
if (TryComp<PowerCellDrawComponent>(uid, out var draw))
draw.Enabled = true;
_powerCell.SetPowerCellDrawEnabled(uid, true);
UpdateBeep(uid, component);
return true;
}