Fix gun cooldown timespan overflow exception (#28136)

This commit is contained in:
Leon Friedrich
2024-05-20 10:07:45 +12:00
committed by GitHub
parent e06b58abce
commit 53213a0200

View File

@@ -112,6 +112,12 @@ public abstract partial class SharedGunSystem
private void OnGunSelected(EntityUid uid, GunComponent component, HandSelectedEvent args)
{
if (Timing.ApplyingState)
return;
if (component.FireRateModified <= 0)
return;
var fireDelay = 1f / component.FireRateModified;
if (fireDelay.Equals(0f))
return;