Fix gun cooldown timespan overflow exception (#28136)

This commit is contained in:
Leon Friedrich
2024-06-01 16:51:22 +02:00
committed by null
parent 9bb599f549
commit d8d385adeb
@@ -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;