From ec9550c2e0ff75911129000ae4e1aa14a16d8b9c Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Wed, 12 Jan 2022 18:25:05 +1100 Subject: [PATCH] Make any mind added remove ghost role (#6127) --- Content.Server/Ghost/Roles/GhostRoleSystem.cs | 7 +++++++ Content.Shared/Ghost/Roles/SharedGhostRoleSystem.cs | 5 ----- 2 files changed, 7 insertions(+), 5 deletions(-) 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 {