Skip to content

Commit

Permalink
Fix masks not toggling voice mask component (space-wizards#22506)
Browse files Browse the repository at this point in the history
  • Loading branch information
DrSmugleaf authored Dec 15, 2023
1 parent 69767ee commit af3a1e5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Content.Shared.Clothing;
using Content.Server.Nutrition.Components;
using Content.Shared.Clothing;

namespace Content.Server.Nutrition.EntitySystems;

Expand All @@ -8,10 +9,10 @@ public override void 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;
}
Expand Down
4 changes: 2 additions & 2 deletions Content.Server/VoiceMask/VoiceMaskSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public override void Initialize()
{
SubscribeLocalEvent<VoiceMaskComponent, TransformSpeakerNameEvent>(OnSpeakerNameTransform);
SubscribeLocalEvent<VoiceMaskComponent, VoiceMaskChangeNameMessage>(OnChangeName);
SubscribeLocalEvent<VoiceMaskComponent, ItemMaskToggledEvent>(OnMaskToggled);
SubscribeLocalEvent<VoiceMaskComponent, WearerMaskToggledEvent>(OnMaskToggled);
SubscribeLocalEvent<VoiceMaskerComponent, GotEquippedEvent>(OnEquip);
SubscribeLocalEvent<VoiceMaskerComponent, GotUnequippedEvent>(OnUnequip);
SubscribeLocalEvent<VoiceMaskSetNameEvent>(OnSetName);
Expand Down Expand Up @@ -69,7 +69,7 @@ private void OnSpeakerNameTransform(EntityUid uid, VoiceMaskComponent component,
}
}

private void OnMaskToggled(Entity<VoiceMaskComponent> ent, ref ItemMaskToggledEvent args)
private void OnMaskToggled(Entity<VoiceMaskComponent> ent, ref WearerMaskToggledEvent args)
{
ent.Comp.Enabled = !args.IsToggled;
}
Expand Down
2 changes: 1 addition & 1 deletion Content.Shared/Clothing/ClothingEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ public sealed partial class ToggleMaskEvent : InstantActionEvent { }
/// Event raised on the entity wearing the mask when it is toggled.
/// </summary>
[ByRefEvent]
public readonly record struct WearerMaskToggledEvent(bool Enabled);
public readonly record struct WearerMaskToggledEvent(bool IsToggled);

0 comments on commit af3a1e5

Please sign in to comment.