Skip to content

Commit

Permalink
Update MoodSystem.cs (#761)
Browse files Browse the repository at this point in the history
# Description

MoodSystem was lacking a Component Shutdown to yeet the alert, so it was
causing intermittent test fails.

---------

Signed-off-by: VMSolidus <[email protected]>
Co-authored-by: DEATHB4DEFEAT <[email protected]>
  • Loading branch information
VMSolidus and DEATHB4DEFEAT authored Aug 21, 2024
1 parent 17129ec commit a7149e2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Content.Server/Mood/MoodSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public override void Initialize()
base.Initialize();

SubscribeLocalEvent<MoodComponent, ComponentStartup>(OnInit);
SubscribeLocalEvent<MoodComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<MoodComponent, MobStateChangedEvent>(OnMobStateChanged);
SubscribeLocalEvent<MoodComponent, MoodEffectEvent>(OnMoodEffect);
SubscribeLocalEvent<MoodComponent, DamageChangedEvent>(OnDamageChange);
Expand All @@ -48,6 +49,11 @@ public override void Initialize()
}


private void OnShutdown(EntityUid uid, MoodComponent component, ComponentShutdown args)
{
_alerts.ClearAlertCategory(uid, AlertCategory.Mood);
}

private void OnRemoveEffect(EntityUid uid, MoodComponent component, MoodRemoveEffectEvent args)
{
if (component.UncategorisedEffects.TryGetValue(args.EffectId, out _))
Expand Down

0 comments on commit a7149e2

Please sign in to comment.