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
This commit is contained in:
metalgearsloth
2021-08-31 22:46:11 +10:00
committed by GitHub
parent df7d6c4d90
commit 0f5b84c560

View File

@@ -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<SharedHandsComponent>()) return;
LandComponent(thrownItem);
}