Give BaseItem a landing sound (#14504)
This commit is contained in:
@@ -8,6 +8,7 @@ using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Physics.Dynamics;
|
||||
using System.Linq;
|
||||
using Content.Shared.Sound.Components;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Events;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
@@ -117,16 +118,17 @@ namespace Content.Shared.Throwing
|
||||
EntityManager.RemoveComponent<ThrownItemComponent>(uid);
|
||||
}
|
||||
|
||||
public void LandComponent(ThrownItemComponent thrownItem, PhysicsComponent physics)
|
||||
public void LandComponent(EntityUid uid, ThrownItemComponent thrownItem, PhysicsComponent physics)
|
||||
{
|
||||
_physics.SetBodyStatus(physics, BodyStatus.OnGround);
|
||||
|
||||
if (thrownItem.Deleted || Deleted(thrownItem.Owner) || _containerSystem.IsEntityInContainer(thrownItem.Owner)) return;
|
||||
if (thrownItem.Deleted || Deleted(uid) || _containerSystem.IsEntityInContainer(uid))
|
||||
return;
|
||||
|
||||
var landing = thrownItem.Owner;
|
||||
var landing = uid;
|
||||
|
||||
// Unfortunately we can't check for hands containers as they have specific names.
|
||||
if (thrownItem.Owner.TryGetContainerMan(out var containerManager) &&
|
||||
if (uid.TryGetContainerMan(out var containerManager) &&
|
||||
EntityManager.HasComponent<SharedHandsComponent>(containerManager.Owner))
|
||||
{
|
||||
EntityManager.RemoveComponent(landing, thrownItem);
|
||||
|
||||
Reference in New Issue
Block a user