Fix inventory flickering and missing InventoryTemplateUpdated event (#39379)

* fix flickering

* move InitClothing

* fix this
This commit is contained in:
slarticodefast
2025-08-06 22:14:28 +02:00
committed by GitHub
parent f76e3b63b7
commit 6b6bb2e319
3 changed files with 11 additions and 6 deletions

View File

@@ -115,6 +115,13 @@ namespace Content.Client.Inventory
OnLinkInventorySlots?.Invoke(uid, component);
}
protected override void OnInit(Entity<InventoryComponent> ent, ref ComponentInit args)
{
base.OnInit(ent, ref args);
_clothingVisualsSystem.InitClothing(ent.Owner, ent.Comp);
}
public override void Shutdown()
{
CommandBinds.Unregister<ClientInventorySystem>();
@@ -261,7 +268,6 @@ namespace Content.Client.Inventory
TryAddSlotData((ent.Owner, inventorySlots), (SlotData)slot);
}
_clothingVisualsSystem.InitClothing(ent, ent.Comp);
if (ent.Owner == _playerManager.LocalEntity)
ReloadInventory(inventorySlots);
}