From 34880bfd47aeb98acb8103ed14a552adc6edda96 Mon Sep 17 00:00:00 2001 From: Samuka <47865393+Samuka-C@users.noreply.github.com> Date: Sun, 26 Jul 2026 17:11:48 -0300 Subject: [PATCH] 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> --- Content.Shared/PowerCell/PowerCellSystem.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Content.Shared/PowerCell/PowerCellSystem.cs b/Content.Shared/PowerCell/PowerCellSystem.cs index a732fc0e48..c7b303392b 100644 --- a/Content.Shared/PowerCell/PowerCellSystem.cs +++ b/Content.Shared/PowerCell/PowerCellSystem.cs @@ -135,8 +135,16 @@ public sealed partial class PowerCellSystem : EntitySystem private void OnDrawRefreshChargeRate(Entity 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 ent, ref ComponentStartup args)