From 391dfe4f4aa4be1e4f1e3eab97349949b85f7ebe Mon Sep 17 00:00:00 2001 From: Princess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com> Date: Sun, 20 Jul 2025 14:23:25 -0700 Subject: [PATCH] Crawling Fixes 2: Salvage Nerf (NPCs can shoot downed targets) (#39085) Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> --- Content.Server/NPC/Systems/NPCCombatSystem.Ranged.cs | 2 +- Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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)); } -- 2.52.0