Disabler locker throwing (#4683)
This commit is contained in:
@@ -17,6 +17,7 @@ using Content.Shared.Notification.Managers;
|
|||||||
using Content.Shared.Physics.Pull;
|
using Content.Shared.Physics.Pull;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Server.Player;
|
using Robust.Server.Player;
|
||||||
|
using Robust.Shared.Containers;
|
||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Input.Binding;
|
using Robust.Shared.Input.Binding;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
@@ -227,13 +228,12 @@ namespace Content.Server.Hands.Systems
|
|||||||
|
|
||||||
var playerEnt = playerSession.AttachedEntity;
|
var playerEnt = playerSession.AttachedEntity;
|
||||||
|
|
||||||
if (playerEnt == null || !playerEnt.IsValid() || !playerEnt.TryGetComponent(out SharedHandsComponent? hands))
|
if (playerEnt == null ||
|
||||||
return false;
|
!playerEnt.IsValid() ||
|
||||||
|
playerEnt.IsInContainer() ||
|
||||||
if (!hands.TryGetActiveHeldEntity(out var throwEnt))
|
!playerEnt.TryGetComponent(out SharedHandsComponent? hands) ||
|
||||||
return false;
|
!hands.TryGetActiveHeldEntity(out var throwEnt) ||
|
||||||
|
!_interactionSystem.TryThrowInteraction(hands.Owner, throwEnt))
|
||||||
if (!_interactionSystem.TryThrowInteraction(hands.Owner, throwEnt))
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (throwEnt.TryGetComponent(out StackComponent? stack) && stack.Count > 1 && stack.ThrowIndividually)
|
if (throwEnt.TryGetComponent(out StackComponent? stack) && stack.Count > 1 && stack.ThrowIndividually)
|
||||||
|
|||||||
Reference in New Issue
Block a user