refactor(SharedGunSystem): use can attach check on shot attempt
if (ev.Cancelled)
return false;
- if (target != null)
- {
- var tev = new GettingAttackedAttemptEvent();
- RaiseLocalEvent(target.Value, ref tev);
- return !tev.Cancelled;
- }
+ if (target == null)
+ return true;
- return true;
+ var tev = new GettingAttackedAttemptEvent();
+ RaiseLocalEvent(target.Value, ref tev);
+ return !tev.Cancelled;
}
public bool CanChangeDirection(EntityUid uid)
private void AttemptShoot(EntityUid user, EntityUid gunUid, GunComponent gun)
{
if (gun.FireRate <= 0f ||
- !_actionBlockerSystem.CanUseHeldEntity(user))
+ !_actionBlockerSystem.CanAttack(user))
return;
var toCoordinates = gun.ShootCoordinates;