From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Sun, 19 May 2024 22:07:45 +0000 (+1200) Subject: Fix gun cooldown timespan overflow exception (#28136) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=53213a02009a6b7f3ec373d69b4be954bbef1784;p=space-station-14.git Fix gun cooldown timespan overflow exception (#28136) --- 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;