return;
}
- _gun.AttemptShoot(uid, gunUid, gun, targetCordinates);
+ _gun.AttemptShoot(uid, gunUid, gun, targetCordinates, comp.Target);
}
}
}
/// <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));
}