Fix instant power cell drainage (#15927)
This commit is contained in:
@@ -19,10 +19,7 @@ public sealed partial class ActivatableUISystem
|
||||
|
||||
private void OnPowerCellRemoved(EntityUid uid, PowerCellDrawComponent component, EntRemovedFromContainerMessage args)
|
||||
{
|
||||
if (TryComp<PowerCellDrawComponent>(uid, out var draw))
|
||||
{
|
||||
draw.Enabled = false;
|
||||
}
|
||||
_cell.SetPowerCellDrawEnabled(uid, false);
|
||||
|
||||
if (HasComp<ActivatableUIRequiresPowerCellComponent>(uid) &&
|
||||
TryComp<ActivatableUIComponent>(uid, out var activatable) &&
|
||||
@@ -34,18 +31,12 @@ public sealed partial class ActivatableUISystem
|
||||
|
||||
private void OnBatteryOpened(EntityUid uid, ActivatableUIRequiresPowerCellComponent component, BoundUIOpenedEvent args)
|
||||
{
|
||||
if (!TryComp<PowerCellDrawComponent>(uid, out var draw))
|
||||
return;
|
||||
|
||||
draw.Enabled = true;
|
||||
_cell.SetPowerCellDrawEnabled(uid, true);
|
||||
}
|
||||
|
||||
private void OnBatteryClosed(EntityUid uid, ActivatableUIRequiresPowerCellComponent component, BoundUIClosedEvent args)
|
||||
{
|
||||
if (!TryComp<PowerCellDrawComponent>(uid, out var draw))
|
||||
return;
|
||||
|
||||
draw.Enabled = false;
|
||||
_cell.SetPowerCellDrawEnabled(uid, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user