Fix helmet toggle bug (#7861)

This commit is contained in:
Leon Friedrich
2022-04-30 16:54:35 +12:00
committed by GitHub
parent 0ec32321bb
commit 33ddd2d73d
2 changed files with 3 additions and 2 deletions

View File

@@ -48,6 +48,7 @@ public sealed class ToggleableClothingComponent : Component
[DataField("containerId")] [DataField("containerId")]
public string ContainerId = DefaultClothingContainerId; public string ContainerId = DefaultClothingContainerId;
[ViewVariables]
public ContainerSlot? Container; public ContainerSlot? Container;
/// <summary> /// <summary>

View File

@@ -26,7 +26,7 @@ public sealed class ToggleableClothingSystem : EntitySystem
{ {
base.Initialize(); base.Initialize();
SubscribeLocalEvent<ToggleableClothingComponent, ComponentAdd>(OnAdd); SubscribeLocalEvent<ToggleableClothingComponent, ComponentInit>(OnInit);
SubscribeLocalEvent<ToggleableClothingComponent, MapInitEvent>(OnMapInit); SubscribeLocalEvent<ToggleableClothingComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<ToggleableClothingComponent, ToggleClothingEvent>(OnToggleClothing); SubscribeLocalEvent<ToggleableClothingComponent, ToggleClothingEvent>(OnToggleClothing);
SubscribeLocalEvent<ToggleableClothingComponent, GetItemActionsEvent>(OnGetActions); SubscribeLocalEvent<ToggleableClothingComponent, GetItemActionsEvent>(OnGetActions);
@@ -163,7 +163,7 @@ public sealed class ToggleableClothingSystem : EntitySystem
args.Actions.Add(component.ToggleAction); 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<ContainerSlot>(uid, component.ContainerId); component.Container = _containerSystem.EnsureContainer<ContainerSlot>(uid, component.ContainerId);
} }