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