Fix helmet toggle bug (#7861)
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user