Skip to content

Commit

Permalink
Update MoodSystem.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
VMSolidus committed Sep 22, 2024
1 parent 900630c commit 48c58f0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Content.Server/Mood/MoodSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,15 @@ private void ApplyEffect(EntityUid uid, MoodComponent component, MoodEffectProto
if (!_prototypeManager.TryIndex<MoodEffectPrototype>(oldPrototypeId, out var oldPrototype))
return;

if (prototype.ID != oldPrototype.ID)
{
// Don't send the moodlet popup if we already have the moodlet.
if (!component.CategorisedEffects.ContainsValue(prototype.ID))
SendEffectText(uid, prototype);

if (prototype.ID != oldPrototype.ID)
component.CategorisedEffects[prototype.Category] = prototype.ID;
}
}
else
{
component.CategorisedEffects.Add(prototype.Category, prototype.ID);
}

if (prototype.Timeout != 0)
Timer.Spawn(TimeSpan.FromSeconds(prototype.Timeout), () => RemoveTimedOutEffect(uid, prototype.ID, prototype.Category));
Expand All @@ -146,7 +145,10 @@ private void ApplyEffect(EntityUid uid, MoodComponent component, MoodEffectProto
if (moodChange == 0)
return;

SendEffectText(uid, prototype);
// Don't send the moodlet popup if we already have the moodlet.
if (!component.UncategorisedEffects.ContainsKey(prototype.ID))
SendEffectText(uid, prototype);

component.UncategorisedEffects.Add(prototype.ID, moodChange);

if (prototype.Timeout != 0)
Expand Down

0 comments on commit 48c58f0

Please sign in to comment.