removing embedded projectiles puts them in your hand (#20475)

* tagless fields

* put embedded projectile in hand when picked up

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-09-27 21:59:12 +02:00
committed by Debug
co-authored by deltanedas
parent 7bda1dd724
commit 14d6128d2b
2 changed files with 11 additions and 6 deletions
@@ -1,6 +1,7 @@
using System.Numerics;
using Content.Shared.Damage;
using Content.Shared.DoAfter;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Interaction;
using Content.Shared.Projectiles;
using Content.Shared.Sound.Components;
@@ -24,6 +25,7 @@ public abstract partial class SharedProjectileSystem : EntitySystem
[Dependency] private readonly INetManager _netManager = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
[Dependency] private readonly SharedHandsSystem _hands = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;
@@ -85,6 +87,9 @@ public abstract partial class SharedProjectileSystem : EntitySystem
var landEv = new LandEvent(args.User, true);
RaiseLocalEvent(uid, ref landEv);
_physics.WakeBody(uid, body: physics);
// try place it in the user's hand
_hands.TryPickupAnyHand(args.User, uid);
}
private void OnEmbedThrowDoHit(EntityUid uid, EmbeddableProjectileComponent component, ThrowDoHitEvent args)