Disabler locker throwing (#4683)

This commit is contained in:
metalgearsloth
2021-09-24 08:44:25 +10:00
committed by GitHub
parent 5add2f1f80
commit 2145124aa4

View File

@@ -17,6 +17,7 @@ using Content.Shared.Notification.Managers;
using Content.Shared.Physics.Pull;
using JetBrains.Annotations;
using Robust.Server.Player;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.Input.Binding;
using Robust.Shared.IoC;
@@ -227,13 +228,12 @@ namespace Content.Server.Hands.Systems
var playerEnt = playerSession.AttachedEntity;
if (playerEnt == null || !playerEnt.IsValid() || !playerEnt.TryGetComponent(out SharedHandsComponent? hands))
return false;
if (!hands.TryGetActiveHeldEntity(out var throwEnt))
return false;
if (!_interactionSystem.TryThrowInteraction(hands.Owner, throwEnt))
if (playerEnt == null ||
!playerEnt.IsValid() ||
playerEnt.IsInContainer() ||
!playerEnt.TryGetComponent(out SharedHandsComponent? hands) ||
!hands.TryGetActiveHeldEntity(out var throwEnt) ||
!_interactionSystem.TryThrowInteraction(hands.Owner, throwEnt))
return false;
if (throwEnt.TryGetComponent(out StackComponent? stack) && stack.Count > 1 && stack.ThrowIndividually)