]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix battery self-recharge mispredicts (#33384)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Wed, 11 Dec 2024 15:58:02 +0000 (02:58 +1100)
committerGitHub <noreply@github.com>
Wed, 11 Dec 2024 15:58:02 +0000 (16:58 +0100)
Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Battery.cs

index ecbd19d517350aef49291f6a4a16e36c88a2cfe9..d6e741fed6e47b1ecfc2429490de66ba731d0a10 100644 (file)
@@ -35,6 +35,7 @@ public abstract partial class SharedGunSystem
         component.Shots = state.Shots;
         component.Capacity = state.MaxShots;
         component.FireCost = state.FireCost;
+        UpdateAmmoCount(uid, prediction: false);
     }
 
     private void OnBatteryGetState(EntityUid uid, BatteryAmmoProviderComponent component, ref ComponentGetState args)
@@ -80,7 +81,10 @@ public abstract partial class SharedGunSystem
     /// <summary>
     /// Update the battery (server-only) whenever fired.
     /// </summary>
-    protected virtual void TakeCharge(EntityUid uid, BatteryAmmoProviderComponent component) {}
+    protected virtual void TakeCharge(EntityUid uid, BatteryAmmoProviderComponent component)
+    {
+        UpdateAmmoCount(uid, prediction: false);
+    }
 
     protected void UpdateBatteryAppearance(EntityUid uid, BatteryAmmoProviderComponent component)
     {