From 33ddd2d73d6f6f5b007e2e73855f0426665a8e3a Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Sat, 30 Apr 2022 16:54:35 +1200 Subject: [PATCH] Fix helmet toggle bug (#7861) --- .../Clothing/Components/ToggleableClothingComponent.cs | 1 + .../Clothing/EntitySystems/ToggleableClothingSystem.cs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Content.Shared/Clothing/Components/ToggleableClothingComponent.cs b/Content.Shared/Clothing/Components/ToggleableClothingComponent.cs index 0a8f0597ec..bce7ec94b9 100644 --- a/Content.Shared/Clothing/Components/ToggleableClothingComponent.cs +++ b/Content.Shared/Clothing/Components/ToggleableClothingComponent.cs @@ -48,6 +48,7 @@ public sealed class ToggleableClothingComponent : Component [DataField("containerId")] public string ContainerId = DefaultClothingContainerId; + [ViewVariables] public ContainerSlot? Container; /// diff --git a/Content.Shared/Clothing/EntitySystems/ToggleableClothingSystem.cs b/Content.Shared/Clothing/EntitySystems/ToggleableClothingSystem.cs index 0aacc16802..dcbf1ca3ac 100644 --- a/Content.Shared/Clothing/EntitySystems/ToggleableClothingSystem.cs +++ b/Content.Shared/Clothing/EntitySystems/ToggleableClothingSystem.cs @@ -26,7 +26,7 @@ public sealed class ToggleableClothingSystem : EntitySystem { base.Initialize(); - SubscribeLocalEvent(OnAdd); + SubscribeLocalEvent(OnInit); SubscribeLocalEvent(OnMapInit); SubscribeLocalEvent(OnToggleClothing); SubscribeLocalEvent(OnGetActions); @@ -163,7 +163,7 @@ public sealed class ToggleableClothingSystem : EntitySystem args.Actions.Add(component.ToggleAction); } - private void OnAdd(EntityUid uid, ToggleableClothingComponent component, ComponentAdd args) + private void OnInit(EntityUid uid, ToggleableClothingComponent component, ComponentInit args) { component.Container = _containerSystem.EnsureContainer(uid, component.ContainerId); }