HandsSystem Refactor (#38438)

* checkpoint

* pt 2

* pt... i forgot

* pt 4

* patch

* More test fixes

* optimization!!!

* the REAL hand system

* fix RetractableItemActionSystem.cs oversight

* the review

* test

* remove test usage of body prototype

* Update Content.IntegrationTests/Tests/Interaction/InteractionTest.cs

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>

* hellcode

* hellcode 2

* Minor cleanup

* test

* Chasing the last of the bugs

* changes

---------

Co-authored-by: Tayrtahn <tayrtahn@gmail.com>
This commit is contained in:
Nemanja
2025-06-25 09:13:03 -04:00
committed by GitHub
parent 6cffa8aabe
commit 524725d378
79 changed files with 849 additions and 897 deletions

View File

@@ -1,3 +1,4 @@
using Content.Server.Hands.Systems;
using Content.Server.Popups;
using Content.Server.Tabletop.Components;
using Content.Shared.CCVar;
@@ -22,6 +23,7 @@ namespace Content.Server.Tabletop
{
[Dependency] private readonly SharedMapSystem _map = default!;
[Dependency] private readonly EyeSystem _eye = default!;
[Dependency] private readonly HandsSystem _hands = default!;
[Dependency] private readonly ViewSubscriberSystem _viewSubscriberSystem = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
@@ -84,18 +86,13 @@ namespace Content.Server.Tabletop
if (component.Session is not { } session)
return;
if (hands.ActiveHand == null)
if (!_hands.TryGetActiveItem(uid, out var handEnt))
return;
if (hands.ActiveHand.HeldEntity == null)
return;
var handEnt = hands.ActiveHand.HeldEntity.Value;
if (!TryComp<ItemComponent>(handEnt, out var item))
return;
var meta = MetaData(handEnt);
var meta = MetaData(handEnt.Value);
var protoId = meta.EntityPrototype?.ID;
var hologram = Spawn(protoId, session.Position.Offset(-1, 0));