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:
Samuka 2026-07-26 17:11:48 -03:00 • committed by GitHub
parent 0c5b250f03
commit 34880bfd47
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)