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:
parent
8e5d70716d
commit
391dfe4f4a
2 changed files with 3 additions and 2 deletions
|
|
@ -205,7 +205,7 @@ public sealed partial class NPCCombatSystem
|
|||
return;
|
||||
}
|
||||
|
||||
_gun.AttemptShoot(uid, gunUid, gun, targetCordinates);
|
||||
_gun.AttemptShoot(uid, gunUid, gun, targetCordinates, comp.Target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue