Crawling Fixes 2: Salvage Nerf (NPCs can shoot downed targets) (#39085)

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
Princess Cheeseballs 2025-07-20 14:23:25 -07:00 committed by Vanessa
parent c77c0b5f21
commit 1d0af70980
2 changed files with 3 additions and 2 deletions

View File

@ -206,7 +206,7 @@ public sealed partial class NPCCombatSystem
}
_gun.SetTarget(gun, comp.Target); // Imp
_gun.AttemptShoot(uid, gunUid, gun, targetCordinates);
_gun.AttemptShoot(uid, gunUid, gun, targetCordinates, comp.Target);
}
}
}

View File

@ -219,11 +219,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));
}