diff --git a/Content.Server/NPC/Systems/NPCCombatSystem.Ranged.cs b/Content.Server/NPC/Systems/NPCCombatSystem.Ranged.cs index 74f992b27d..d4f9728293 100644 --- a/Content.Server/NPC/Systems/NPCCombatSystem.Ranged.cs +++ b/Content.Server/NPC/Systems/NPCCombatSystem.Ranged.cs @@ -205,7 +205,7 @@ public sealed partial class NPCCombatSystem return; } - _gun.AttemptShoot(uid, gunUid, gun, targetCordinates); + _gun.AttemptShoot(uid, gunUid, gun, targetCordinates, comp.Target); } } } diff --git a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs index 624781292a..ba8254f68a 100644 --- a/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs +++ b/Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs @@ -207,11 +207,12 @@ public abstract partial class SharedGunSystem : EntitySystem /// /// Attempts to shoot at the target coordinates. Resets the shot counter after every shot. /// - public void AttemptShoot(EntityUid user, EntityUid gunUid, GunComponent gun, EntityCoordinates toCoordinates) + public void AttemptShoot(EntityUid user, EntityUid gunUid, GunComponent gun, EntityCoordinates toCoordinates, EntityUid? target = null) { gun.ShootCoordinates = toCoordinates; AttemptShoot(user, gunUid, gun); gun.ShotCounter = 0; + gun.Target = target; DirtyField(gunUid, gun, nameof(GunComponent.ShotCounter)); }