Fix battery self-recharge mispredicts (#33384)

This commit is contained in:
metalgearsloth
2024-12-12 02:58:02 +11:00
committed by GitHub
parent 976cae9c78
commit 1a8e469c58

View 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)
{