From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Wed, 11 Dec 2024 15:58:02 +0000 (+1100) Subject: Fix battery self-recharge mispredicts (#33384) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=1a8e469c586102cce8558662143d0bb7a4d72f77;p=space-station-14.git Fix battery self-recharge mispredicts (#33384) --- 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) {