@@ -9,6 +9,7 @@ using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.Events;
|
||||
using Content.Shared.Speech;
|
||||
using Content.Shared.Throwing;
|
||||
using Content.Shared.Weapons.Melee;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Containers;
|
||||
|
||||
@@ -145,7 +146,7 @@ namespace Content.Shared.ActionBlocker
|
||||
return !ev.Cancelled;
|
||||
}
|
||||
|
||||
public bool CanAttack(EntityUid uid, EntityUid? target = null)
|
||||
public bool CanAttack(EntityUid uid, EntityUid? target = null, Entity<MeleeWeaponComponent>? weapon = null, bool disarm = false)
|
||||
{
|
||||
_container.TryGetOuterContainer(uid, Transform(uid), out var outerContainer);
|
||||
if (target != null && target != outerContainer?.Owner && _container.IsEntityInContainer(uid))
|
||||
@@ -155,7 +156,7 @@ namespace Content.Shared.ActionBlocker
|
||||
return containerEv.CanAttack;
|
||||
}
|
||||
|
||||
var ev = new AttackAttemptEvent(uid, target);
|
||||
var ev = new AttackAttemptEvent(uid, target, weapon, disarm);
|
||||
RaiseLocalEvent(uid, ev);
|
||||
|
||||
if (ev.Cancelled)
|
||||
|
||||
Reference in New Issue
Block a user