]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Crawling Fixes 2: Salvage Nerf (NPCs can shoot downed targets) (#39085)
authorPrincess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com>
Sun, 20 Jul 2025 21:23:25 +0000 (14:23 -0700)
committerGitHub <noreply@github.com>
Sun, 20 Jul 2025 21:23:25 +0000 (23:23 +0200)
Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
Content.Server/NPC/Systems/NPCCombatSystem.Ranged.cs
Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs

index 74f992b27dcf516036379f6f988803245d7f6a3d..d4f972829353e510cca8a5367ca53a716fae2e36 100644 (file)
@@ -205,7 +205,7 @@ public sealed partial class NPCCombatSystem
                 return;
             }
 
-            _gun.AttemptShoot(uid, gunUid, gun, targetCordinates);
+            _gun.AttemptShoot(uid, gunUid, gun, targetCordinates, comp.Target);
         }
     }
 }
index 624781292abd4937ab56ec29c141ccfec7ec74e0..ba8254f68a3514e226a276602d4735471d979588 100644 (file)
@@ -207,11 +207,12 @@ public abstract partial class SharedGunSystem : EntitySystem
     /// <summary>
     /// Attempts to shoot at the target coordinates. Resets the shot counter after every shot.
     /// </summary>
-    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));
     }