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>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user