diff --git a/Assets/Scripts/ServerShared/Behaviors/ChargedWeapon.cs b/Assets/Scripts/ServerShared/Behaviors/ChargedWeapon.cs index 4d2bb5647..c3229622c 100644 --- a/Assets/Scripts/ServerShared/Behaviors/ChargedWeapon.cs +++ b/Assets/Scripts/ServerShared/Behaviors/ChargedWeapon.cs @@ -157,8 +157,7 @@ public class ChargedWeapon : InstantWeapon if (_data.FailureCharge > 1 && _charge > _data.FailureCharge) { _charging = false; - _cooldown = 1; - _coolingDown = true; + StartCountdown(); _charge = 0; OnFailed?.Invoke(); CauseDamage(_data.FailureDamage); diff --git a/Assets/Scripts/ServerShared/Behaviors/InstantWeapon.cs b/Assets/Scripts/ServerShared/Behaviors/InstantWeapon.cs index 84e6dd5c2..eaf739ce0 100644 --- a/Assets/Scripts/ServerShared/Behaviors/InstantWeapon.cs +++ b/Assets/Scripts/ServerShared/Behaviors/InstantWeapon.cs @@ -203,6 +203,13 @@ public class InstantWeapon : Weapon, IProgressBehavior, IEventBehavior, IPowerCo private float CountdownSpan => _data.MagazineSize > 0 && _ammo == 0 ? _data.ReloadTime : Cooldown; + // A countdown that starts outside a round (a charge failing) carries the last one's overshoot like every restart. + protected void StartCountdown() + { + _cooldown = 1 - TakeOvershoot() / CountdownSpan; + _coolingDown = true; + } + private float TakeOvershoot() { var overshoot = _overshoot;