diff --git a/Content.Server/Ghost/Roles/ToggleableGhostRoleSystem.cs b/Content.Server/Ghost/Roles/ToggleableGhostRoleSystem.cs
index d78df4f2a2..774de4e191 100644
--- a/Content.Server/Ghost/Roles/ToggleableGhostRoleSystem.cs
+++ b/Content.Server/Ghost/Roles/ToggleableGhostRoleSystem.cs
@@ -1,5 +1,4 @@
-using Content.Server.Ghost.Roles.Components;
-using Content.Server.PAI;
+using Content.Server.Ghost.Roles.Components;
using Content.Shared.Examine;
using Content.Shared.Interaction.Events;
using Content.Shared.Mind;
@@ -17,8 +16,6 @@ public sealed class ToggleableGhostRoleSystem : EntitySystem
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
[Dependency] private readonly SharedMindSystem _mind = default!;
- //todo this really shouldn't be in here but this system was converted from PAIs
- [Dependency] private readonly PAISystem _pai = default!;
///
public override void Initialize()
@@ -86,6 +83,8 @@ public sealed class ToggleableGhostRoleSystem : EntitySystem
private void OnMindRemoved(EntityUid uid, ToggleableGhostRoleComponent component, MindRemovedMessage args)
{
+ // Mind was removed, prepare for re-toggle of the role
+ RemCompDeferred(uid);
UpdateAppearance(uid, ToggleableGhostRoleStatus.Off);
}
@@ -110,11 +109,8 @@ public sealed class ToggleableGhostRoleSystem : EntitySystem
return;
// Wiping device :(
// The shutdown of the Mind should cause automatic reset of the pAI during OnMindRemoved
- // EDIT: But it doesn't!!!! Wtf? Do stuff manually
_mind.TransferTo(mindId, null, mind: mind);
_popup.PopupEntity(Loc.GetString(component.WipeVerbPopup), uid, args.User, PopupType.Large);
- UpdateAppearance(uid, ToggleableGhostRoleStatus.Off);
- _pai.PAITurningOff(uid);
}
};
args.Verbs.Add(verb);
@@ -132,7 +128,6 @@ public sealed class ToggleableGhostRoleSystem : EntitySystem
RemCompDeferred(uid);
_popup.PopupEntity(Loc.GetString(component.StopSearchVerbPopup), uid, args.User);
UpdateAppearance(uid, ToggleableGhostRoleStatus.Off);
- _pai.PAITurningOff(uid);
}
};
args.Verbs.Add(verb);