Fix masks not toggling voice mask component (#22506)
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using Content.Shared.Clothing;
|
using Content.Server.Nutrition.Components;
|
||||||
|
using Content.Shared.Clothing;
|
||||||
|
|
||||||
namespace Content.Server.Nutrition.EntitySystems;
|
namespace Content.Server.Nutrition.EntitySystems;
|
||||||
|
|
||||||
@@ -8,10 +9,10 @@ public sealed class IngestionBlockerSystem : EntitySystem
|
|||||||
{
|
{
|
||||||
base.Initialize();
|
base.Initialize();
|
||||||
|
|
||||||
SubscribeLocalEvent<Components.IngestionBlockerComponent, ItemMaskToggledEvent>(OnBlockerMaskToggled);
|
SubscribeLocalEvent<IngestionBlockerComponent, ItemMaskToggledEvent>(OnBlockerMaskToggled);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnBlockerMaskToggled(Entity<Components.IngestionBlockerComponent> ent, ref ItemMaskToggledEvent args)
|
private void OnBlockerMaskToggled(Entity<IngestionBlockerComponent> ent, ref ItemMaskToggledEvent args)
|
||||||
{
|
{
|
||||||
ent.Comp.Enabled = !args.IsToggled;
|
ent.Comp.Enabled = !args.IsToggled;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public sealed partial class VoiceMaskSystem : EntitySystem
|
|||||||
{
|
{
|
||||||
SubscribeLocalEvent<VoiceMaskComponent, TransformSpeakerNameEvent>(OnSpeakerNameTransform);
|
SubscribeLocalEvent<VoiceMaskComponent, TransformSpeakerNameEvent>(OnSpeakerNameTransform);
|
||||||
SubscribeLocalEvent<VoiceMaskComponent, VoiceMaskChangeNameMessage>(OnChangeName);
|
SubscribeLocalEvent<VoiceMaskComponent, VoiceMaskChangeNameMessage>(OnChangeName);
|
||||||
SubscribeLocalEvent<VoiceMaskComponent, ItemMaskToggledEvent>(OnMaskToggled);
|
SubscribeLocalEvent<VoiceMaskComponent, WearerMaskToggledEvent>(OnMaskToggled);
|
||||||
SubscribeLocalEvent<VoiceMaskerComponent, GotEquippedEvent>(OnEquip);
|
SubscribeLocalEvent<VoiceMaskerComponent, GotEquippedEvent>(OnEquip);
|
||||||
SubscribeLocalEvent<VoiceMaskerComponent, GotUnequippedEvent>(OnUnequip);
|
SubscribeLocalEvent<VoiceMaskerComponent, GotUnequippedEvent>(OnUnequip);
|
||||||
SubscribeLocalEvent<VoiceMaskSetNameEvent>(OnSetName);
|
SubscribeLocalEvent<VoiceMaskSetNameEvent>(OnSetName);
|
||||||
@@ -69,7 +69,7 @@ public sealed partial class VoiceMaskSystem : EntitySystem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnMaskToggled(Entity<VoiceMaskComponent> ent, ref ItemMaskToggledEvent args)
|
private void OnMaskToggled(Entity<VoiceMaskComponent> ent, ref WearerMaskToggledEvent args)
|
||||||
{
|
{
|
||||||
ent.Comp.Enabled = !args.IsToggled;
|
ent.Comp.Enabled = !args.IsToggled;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,4 +70,4 @@ public readonly record struct ItemMaskToggledEvent(EntityUid Wearer, bool IsTogg
|
|||||||
/// Event raised on the entity wearing the mask when it is toggled.
|
/// Event raised on the entity wearing the mask when it is toggled.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ByRefEvent]
|
[ByRefEvent]
|
||||||
public readonly record struct WearerMaskToggledEvent(bool Enabled);
|
public readonly record struct WearerMaskToggledEvent(bool IsToggled);
|
||||||
|
|||||||
Reference in New Issue
Block a user