From 1a8e469c586102cce8558662143d0bb7a4d72f77 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Thu, 12 Dec 2024 02:58:02 +1100 Subject: [PATCH] Fix battery self-recharge mispredicts (#33384) --- .../Weapons/Ranged/Systems/SharedGunSystem.Battery.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Battery.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Battery.cs index ecbd19d517..d6e741fed6 100644 --- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Battery.cs +++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Battery.cs @@ -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 /// /// Update the battery (server-only) whenever fired. /// - 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) { -- 2.51.2