Use can attach check on shot attempt (#24396)
refactor(SharedGunSystem): use can attach check on shot attempt (cherry picked from commit 7b2e382929204d4fa39ff599c3365c1b237de2e9)
This commit is contained in:
parent
25af0681d5
commit
1afa84e323
|
|
@ -162,14 +162,12 @@ namespace Content.Shared.ActionBlocker
|
||||||
if (ev.Cancelled)
|
if (ev.Cancelled)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (target != null)
|
if (target == null)
|
||||||
{
|
return true;
|
||||||
var tev = new GettingAttackedAttemptEvent();
|
|
||||||
RaiseLocalEvent(target.Value, ref tev);
|
|
||||||
return !tev.Cancelled;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
var tev = new GettingAttackedAttemptEvent();
|
||||||
|
RaiseLocalEvent(target.Value, ref tev);
|
||||||
|
return !tev.Cancelled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanChangeDirection(EntityUid uid)
|
public bool CanChangeDirection(EntityUid uid)
|
||||||
|
|
|
||||||
|
|
@ -232,7 +232,7 @@ public abstract partial class SharedGunSystem : EntitySystem
|
||||||
private void AttemptShoot(EntityUid user, EntityUid gunUid, GunComponent gun)
|
private void AttemptShoot(EntityUid user, EntityUid gunUid, GunComponent gun)
|
||||||
{
|
{
|
||||||
if (gun.FireRate <= 0f ||
|
if (gun.FireRate <= 0f ||
|
||||||
!_actionBlockerSystem.CanUseHeldEntity(user))
|
!_actionBlockerSystem.CanAttack(user))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var toCoordinates = gun.ShootCoordinates;
|
var toCoordinates = gun.ShootCoordinates;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue