From: Princess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com> Date: Sun, 20 Jul 2025 21:23:25 +0000 (-0700) Subject: Crawling Fixes 2: Salvage Nerf (NPCs can shoot downed targets) (#39085) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=391dfe4f4aa4be1e4f1e3eab97349949b85f7ebe;p=space-station-14.git Crawling Fixes 2: Salvage Nerf (NPCs can shoot downed targets) (#39085) Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> --- 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)); }