diff --git a/Content.Server/Actions/DisarmAction.cs b/Content.Server/Actions/DisarmAction.cs index 5960b4636b..f6b46c24eb 100644 --- a/Content.Server/Actions/DisarmAction.cs +++ b/Content.Server/Actions/DisarmAction.cs @@ -2,6 +2,7 @@ using System; using System.Linq; using Content.Server.GameObjects.EntitySystems; +using Content.Server.GameObjects.EntitySystems.Click; using Content.Server.Interfaces.GameObjects; using Content.Server.Utility; using Content.Shared.Actions; @@ -39,7 +40,23 @@ namespace Content.Server.Actions { var disarmedActs = args.Target.GetAllComponents().ToArray(); - if (disarmedActs.Length == 0 || !args.Performer.InRangeUnobstructed(args.Target)) return; + if (!args.Performer.InRangeUnobstructed(args.Target)) return; + + if (disarmedActs.Length == 0) + { + if (args.Performer.TryGetComponent(out IActorComponent? actor)) + { + // Fall back to a normal interaction with the entity + var player = actor.playerSession; + var coordinates = args.Target.Transform.Coordinates; + var target = args.Target.Uid; + EntitySystem.Get().HandleClientUseItemInHand(player, coordinates, target); + return; + } + + return; + } + if (!args.Performer.TryGetComponent(out var actions)) return; if (args.Target == args.Performer || !args.Performer.CanAttack()) return; diff --git a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs index 8c5e1a8562..90c3b2b852 100644 --- a/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/Click/InteractionSystem.cs @@ -201,7 +201,7 @@ namespace Content.Server.GameObjects.EntitySystems.Click } } - private bool HandleClientUseItemInHand(ICommonSession session, EntityCoordinates coords, EntityUid uid) + public bool HandleClientUseItemInHand(ICommonSession session, EntityCoordinates coords, EntityUid uid) { // client sanitization if (!coords.IsValid(_entityManager))