From 53213a02009a6b7f3ec373d69b4be954bbef1784 Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Mon, 20 May 2024 10:07:45 +1200 Subject: [PATCH] Fix gun cooldown timespan overflow exception (#28136) --- .../Weapons/Ranged/Systems/SharedGunSystem.Interactions.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Interactions.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Interactions.cs index 274828a208..f3ff89a660 100644 --- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Interactions.cs +++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.Interactions.cs @@ -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; -- 2.51.2