Fix stripping menu hands' items not showing correctly.

This commit is contained in:
Víctor Aguilera Puerto
2020-08-23 15:03:01 +02:00
parent fad6cdd4d1
commit 39f346ed42

View File

@@ -43,14 +43,16 @@ namespace Content.Server.GameObjects.Components.GUI
UserInterface.OnReceiveMessage += HandleUserInterfaceMessage;
}
Owner.EnsureComponent<InventoryComponent>();
Owner.EnsureComponent<HandsComponent>();
if (Owner.TryGetComponent(out InventoryComponent? inventory))
{
inventory.OnItemChanged += UpdateSubscribed;
}
if (Owner.TryGetComponent(out HandsComponent? hands))
{
hands.OnItemChanged += UpdateSubscribed;
}
// Initial update.
UpdateSubscribed();
}