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-24 21:33:36 +01:00
committed by GitHub
parent 0a607f5fd7
commit 5e405380ef
2 changed files with 11 additions and 6 deletions

View File

@@ -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)