Skip to content

Commit

Permalink
Update SharedGunSystem.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Mor-Dast authored Dec 21, 2024
1 parent 1d3eb4c commit 2dfc4fa
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Content.Shared/Weapons/Ranged/Systems/SharedGunSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,14 @@ public void AttemptShoot(EntityUid gunUid, GunComponent gun)
gun.ShotCounter = 0;
}

/// <summary>
/// Sets the targeted entity of the gun. Should be called before attempting to shoot to avoid shooting over the target.
/// </summary>
public void SetTarget(GunComponent gun, EntityUid target)
{
gun.Target = target;
}

private void AttemptShoot(EntityUid user, EntityUid gunUid, GunComponent gun)
{
if (gun.FireRateModified <= 0f ||
Expand Down

0 comments on commit 2dfc4fa

Please sign in to comment.