Adds the ability to assign equip sounds in ClothingComponent (#4485)

* Initial

* Works (Kinda)

* Polish

* Reviews
This commit is contained in:
Swept
2021-08-19 21:22:23 -07:00
committed by GitHub
parent aa41db5a22
commit 45030b22a3
6 changed files with 20 additions and 7 deletions

View File

@@ -520,14 +520,10 @@ namespace Content.Server.Inventory.Components
var hands = Owner.GetComponent<HandsComponent>();
var activeHand = hands.ActiveHand;
var activeItem = hands.GetActiveHand;
if (activeHand != null && activeItem != null && activeItem.Owner.TryGetComponent(out ItemComponent? clothing))
if (activeHand != null && activeItem != null && activeItem.Owner.TryGetComponent(out ClothingComponent? clothing))
{
hands.TryDropNoInteraction();
if (!Equip(msg.Inventoryslot, clothing, true, out var reason))
{
hands.PutInHand(clothing);
Owner.PopupMessageCursor(reason);
}
clothing.TryEquip(this, msg.Inventoryslot, Owner);
}
break;