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
c77c0b5f21
commit
1d0af70980
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue