]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix charges (#36714)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Sat, 19 Apr 2025 08:49:02 +0000 (18:49 +1000)
committerGitHub <noreply@github.com>
Sat, 19 Apr 2025 08:49:02 +0000 (18:49 +1000)
We have the absolute value so use that.

Content.Shared/Charges/Systems/SharedChargesSystem.cs

index 2eb05f8bfce809da3662996c29f6e0d96ebab665..4805e5a4410947b34f9e0548891f30b6067ec2d8 100644 (file)
@@ -118,7 +118,7 @@ public abstract class SharedChargesSystem : EntitySystem
             action.Comp.LastUpdate = _timing.CurTime;
         }
 
-        action.Comp.LastCharges = Math.Clamp(action.Comp.LastCharges + addCharges, 0, action.Comp.MaxCharges);
+        action.Comp.LastCharges = Math.Clamp(charges, 0, action.Comp.MaxCharges);
         Dirty(action);
     }