Skip to content

Commit

Permalink
Fixed thaven emagging happening multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
TGRCdev committed Feb 10, 2025
1 parent 6dc5f9a commit 41e92dc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Content.Server/_Impstation/Thaven/ThavenMoodSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,9 @@ private void OnThavenMoodShutdown(EntityUid uid, ThavenMoodsComponent comp, Comp
protected override void OnEmagged(EntityUid uid, ThavenMoodsComponent comp, ref GotEmaggedEvent args)
{
base.OnEmagged(uid, comp, ref args);
if(!args.Handled)
return;

TryAddRandomMood(uid, WildcardDataset, comp);
}
}
11 changes: 11 additions & 0 deletions Content.Shared/_Impstation/Thaven/SharedThavenMoodSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ namespace Content.Shared._Impstation.Thaven;

public abstract class SharedThavenMoodSystem : EntitySystem
{
[Dependency] private readonly EmagSystem _emag = default!;

public override void Initialize()
{
base.Initialize();
Expand All @@ -13,6 +15,15 @@ public override void Initialize()

protected virtual void OnEmagged(EntityUid uid, ThavenMoodsComponent comp, ref GotEmaggedEvent args)
{
if (!_emag.CompareFlag(args.Type, EmagType.Interaction))
return;

if (_emag.CheckFlag(uid, EmagType.Interaction))
return;

if (uid == args.UserUid)
return;

args.Handled = true;
}
}

0 comments on commit 41e92dc

Please sign in to comment.