Remove hands component reference (#15197)

This commit is contained in:
DrSmugleaf
2023-04-07 11:21:12 -07:00
committed by GitHub
parent c54ee5290b
commit b947856431
73 changed files with 277 additions and 328 deletions

View File

@@ -1,5 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using Content.Shared.ActionBlocker;
using Content.Shared.Clothing.Components;
using Content.Shared.Hands;
using Content.Shared.Hands.Components;
@@ -41,7 +40,7 @@ public abstract partial class InventorySystem
protected void QuickEquip(EntityUid uid, ClothingComponent component, UseInHandEvent args)
{
if (!TryComp(args.User, out InventoryComponent? inv)
|| !TryComp(args.User, out SharedHandsComponent? hands)
|| !TryComp(args.User, out HandsComponent? hands)
|| !_prototypeManager.TryIndex<InventoryTemplatePrototype>(inv.TemplateId, out var prototype))
return;
@@ -108,7 +107,7 @@ public abstract partial class InventorySystem
if (eventArgs.SenderSession.AttachedEntity is not { Valid: true } actor)
return;
if (!TryComp(actor, out InventoryComponent? inventory) || !TryComp<SharedHandsComponent>(actor, out var hands))
if (!TryComp(actor, out InventoryComponent? inventory) || !TryComp<HandsComponent>(actor, out var hands))
return;
var held = hands.ActiveHandEntity;
@@ -245,7 +244,7 @@ public abstract partial class InventorySystem
return actor != target &&
HasComp<StrippableComponent>(target) &&
HasComp<StrippingComponent>(actor) &&
HasComp<SharedHandsComponent>(actor);
HasComp<HandsComponent>(actor);
}
public bool CanEquip(EntityUid uid, EntityUid itemUid, string slot, [NotNullWhen(false)] out string? reason,