mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
Fix powercelldraw (#44361)
* fix * remove a bunch of unecessary lines Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> * remove redundant line * fix code flow Co-authored-by: Princess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com> * ops --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> Co-authored-by: Princess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com>
This commit is contained in:
parent
0c5b250f03
commit
34880bfd47
1 changed files with 10 additions and 2 deletions
|
|
@ -135,8 +135,16 @@ public sealed partial class PowerCellSystem : EntitySystem
|
|||
|
||||
private void OnDrawRefreshChargeRate(Entity<PowerCellDrawComponent> ent, ref RefreshChargeRateEvent args)
|
||||
{
|
||||
if (ent.Comp.Enabled)
|
||||
args.NewChargeRate -= ent.Comp.DrawRate;
|
||||
if (!ent.Comp.Enabled)
|
||||
return;
|
||||
|
||||
args.NewChargeRate -= ent.Comp.DrawRate;
|
||||
|
||||
// If PowerCellDraw is enabled. then it should set the charge cooldown on the self recharging battery
|
||||
if (!TryGetBatteryFromSlot(ent.Owner, out var battery))
|
||||
return;
|
||||
|
||||
_battery.TrySetChargeCooldown(battery.Value.Owner);
|
||||
}
|
||||
|
||||
private void OnDrawStartup(Entity<PowerCellDrawComponent> ent, ref ComponentStartup args)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue