From 0f5b84c5602f6d8d804e171f344afdbb319cedff Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Tue, 31 Aug 2021 22:46:11 +1000 Subject: [PATCH] Don't call LandEvent if the item is caught (#4512) * Don't call LandEvent if the item is caught Or more specifically if it's inserted into a container. * Soft hands check --- Content.Shared/Throwing/ThrownItemSystem.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Content.Shared/Throwing/ThrownItemSystem.cs b/Content.Shared/Throwing/ThrownItemSystem.cs index 5cae3976a0..276023dde2 100644 --- a/Content.Shared/Throwing/ThrownItemSystem.cs +++ b/Content.Shared/Throwing/ThrownItemSystem.cs @@ -1,7 +1,9 @@ using System.Collections.Generic; using System.Linq; +using Content.Shared.Hands.Components; using Content.Shared.Physics; using Content.Shared.Physics.Pull; +using Robust.Shared.Containers; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Log; @@ -77,6 +79,10 @@ namespace Content.Shared.Throwing private void HandleSleep(EntityUid uid, ThrownItemComponent thrownItem, PhysicsSleepMessage message) { + // Unfortunately we can't check for hands containers as they have specific names. + if (EntityManager.GetEntity(uid).TryGetContainerMan(out var manager) && + manager.Owner.HasComponent()) return; + LandComponent(thrownItem); }