diff --git a/Content.Server/Ghost/Roles/GhostRoleSystem.cs b/Content.Server/Ghost/Roles/GhostRoleSystem.cs index bfea1999e3..35100e807b 100644 --- a/Content.Server/Ghost/Roles/GhostRoleSystem.cs +++ b/Content.Server/Ghost/Roles/GhostRoleSystem.cs @@ -48,6 +48,7 @@ namespace Content.Server.Ghost.Roles SubscribeLocalEvent(Reset); SubscribeLocalEvent(OnPlayerAttached); + SubscribeLocalEvent(OnMindAdded); SubscribeLocalEvent(OnMindRemoved); SubscribeLocalEvent(OnMobStateChanged); _playerManager.PlayerStatusChanged += PlayerStatusChanged; @@ -228,6 +229,12 @@ namespace Content.Server.Ghost.Roles CloseEui(message.Player); } + private void OnMindAdded(EntityUid uid, GhostTakeoverAvailableComponent component, MindAddedMessage args) + { + component.Taken = true; + UnregisterGhostRole(component); + } + private void OnMindRemoved(EntityUid uid, GhostRoleComponent component, MindRemovedMessage args) { // Avoid re-registering it for duplicate entries and potential exceptions. diff --git a/Content.Shared/Ghost/Roles/SharedGhostRoleSystem.cs b/Content.Shared/Ghost/Roles/SharedGhostRoleSystem.cs index 876097783e..b3efb6c3ec 100644 --- a/Content.Shared/Ghost/Roles/SharedGhostRoleSystem.cs +++ b/Content.Shared/Ghost/Roles/SharedGhostRoleSystem.cs @@ -4,11 +4,6 @@ using Robust.Shared.Serialization; namespace Content.Shared.Ghost.Roles { - public abstract class SharedGhostRoleSystem : EntitySystem - { - - } - [Serializable, NetSerializable] public class GhostRole {