diff --git a/Content.Server/Hands/Systems/HandsSystem.cs b/Content.Server/Hands/Systems/HandsSystem.cs index e7527e2c76..4c6b80bd98 100644 --- a/Content.Server/Hands/Systems/HandsSystem.cs +++ b/Content.Server/Hands/Systems/HandsSystem.cs @@ -20,6 +20,7 @@ using Robust.Shared.GameStates; using Robust.Shared.Input.Binding; using Robust.Shared.Map; using Robust.Shared.Player; +using Robust.Shared.Random; using Robust.Shared.Timing; using Robust.Shared.Utility; @@ -28,6 +29,7 @@ namespace Content.Server.Hands.Systems public sealed class HandsSystem : SharedHandsSystem { [Dependency] private readonly IGameTiming _timing = default!; + [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly StackSystem _stackSystem = default!; [Dependency] private readonly VirtualItemSystem _virtualItemSystem = default!; [Dependency] private readonly ActionBlockerSystem _actionBlockerSystem = default!; @@ -91,7 +93,8 @@ namespace Content.Server.Hands.Systems if (TryComp(uid, out PullerComponent? puller) && TryComp(puller.Pulling, out PullableComponent? pullable)) _pullingSystem.TryStopPull(puller.Pulling.Value, pullable); - if (!_handsSystem.TryDrop(uid, component.ActiveHand!, null, checkActionBlocker: false)) + var offsetRandomCoordinates = _transformSystem.GetMoverCoordinates(args.Target).Offset(_random.NextVector2(1f, 1.5f)); + if (!ThrowHeldItem(args.Target, offsetRandomCoordinates)) return; args.PopupPrefix = "disarm-action-";