Use can attach check on shot attempt (#24396)
refactor(SharedGunSystem): use can attach check on shot attempt
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -230,7 +230,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;
|
||||||
|
|||||||
Reference in New Issue
Block a user