From cf68d38aaf9f35c650ad355e36b501a26ebd612d Mon Sep 17 00:00:00 2001 From: Errant <35878406+Errant-4@users.noreply.github.com> Date: Mon, 21 Aug 2023 18:27:08 +0000 Subject: [PATCH] Dead mobs can no longer shoot guns (#19020) * dead shooting hotfix * dead shooting hotfix weh * AttemptShoot check * actionblocker check --------- Co-authored-by: Errant <35878406+errant@users.noreply.github.com> --- Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs index bc64985544..1e6a5c50e9 100644 --- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs +++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs @@ -1,4 +1,5 @@ using System.Diagnostics.CodeAnalysis; +using Content.Shared.ActionBlocker; using Content.Shared.Actions; using Content.Shared.Administration.Logs; using Content.Shared.Audio; @@ -33,6 +34,7 @@ namespace Content.Shared.Weapons.Ranged.Systems; public abstract partial class SharedGunSystem : EntitySystem { + [Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!; [Dependency] protected readonly IGameTiming Timing = default!; [Dependency] protected readonly IMapManager MapManager = default!; [Dependency] private readonly INetManager _netManager = default!; @@ -208,7 +210,8 @@ public abstract partial class SharedGunSystem : EntitySystem private void AttemptShoot(EntityUid user, EntityUid gunUid, GunComponent gun) { - if (gun.FireRate <= 0f) + if (gun.FireRate <= 0f || + !_actionBlockerSystem.CanUseHeldEntity(user)) return; var toCoordinates = gun.ShootCoordinates;