diff --git a/Content.Client/Inventory/ClientInventorySystem.cs b/Content.Client/Inventory/ClientInventorySystem.cs index 1f926b42a1..97da176ed2 100644 --- a/Content.Client/Inventory/ClientInventorySystem.cs +++ b/Content.Client/Inventory/ClientInventorySystem.cs @@ -115,6 +115,13 @@ namespace Content.Client.Inventory OnLinkInventorySlots?.Invoke(uid, component); } + protected override void OnInit(Entity ent, ref ComponentInit args) + { + base.OnInit(ent, ref args); + + _clothingVisualsSystem.InitClothing(ent.Owner, ent.Comp); + } + public override void Shutdown() { CommandBinds.Unregister(); @@ -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); } diff --git a/Content.Shared/Inventory/InventorySystem.Equip.cs b/Content.Shared/Inventory/InventorySystem.Equip.cs index 3ed068070a..ae038b63f3 100644 --- a/Content.Shared/Inventory/InventorySystem.Equip.cs +++ b/Content.Shared/Inventory/InventorySystem.Equip.cs @@ -194,8 +194,6 @@ public abstract partial class InventorySystem if (triggerHandContact && !((slotDefinition.SlotFlags & SlotFlags.GLOVES) == 0)) TriggerHandContactInteraction(target); - Dirty(target, inventory); - _movementSpeed.RefreshMovementSpeedModifiers(target); return true; @@ -487,8 +485,6 @@ public abstract partial class InventorySystem if (triggerHandContact && !((slotDefinition.SlotFlags & SlotFlags.GLOVES) == 0)) TriggerHandContactInteraction(target); - Dirty(target, inventory); - _movementSpeed.RefreshMovementSpeedModifiers(target); return true; diff --git a/Content.Shared/Inventory/InventorySystem.Slots.cs b/Content.Shared/Inventory/InventorySystem.Slots.cs index 09c3bbc45b..3f0bdf10d4 100644 --- a/Content.Shared/Inventory/InventorySystem.Slots.cs +++ b/Content.Shared/Inventory/InventorySystem.Slots.cs @@ -74,7 +74,7 @@ public partial class InventorySystem : EntitySystem Dirty(target, targetComp); } - private void OnInit(Entity ent, ref ComponentInit args) + protected virtual void OnInit(Entity ent, ref ComponentInit args) { UpdateInventoryTemplate(ent); } @@ -111,6 +111,9 @@ public partial class InventorySystem : EntitySystem container.OccludesLight = false; ent.Comp.Containers[i] = container; } + + var ev = new InventoryTemplateUpdated(); + RaiseLocalEvent(ent, ref ev); } private void OnOpenSlotStorage(OpenSlotStorageNetworkMessage ev, EntitySessionEventArgs args)