diff --git a/Content.Server/Ghost/Roles/GhostRoleSystem.cs b/Content.Server/Ghost/Roles/GhostRoleSystem.cs index 02592358a51..90abb982865 100644 --- a/Content.Server/Ghost/Roles/GhostRoleSystem.cs +++ b/Content.Server/Ghost/Roles/GhostRoleSystem.cs @@ -34,6 +34,7 @@ using Content.Shared.Verbs; using Robust.Shared.Collections; using Content.Shared.Ghost.Roles.Components; +using Content.Shared.Mobs.Systems; using Content.Shared.Roles.Jobs; using Content.Sunrise.Interfaces.Shared; // Sunrise-Sponsors @@ -55,6 +56,7 @@ public sealed class GhostRoleSystem : EntitySystem [Dependency] private readonly PopupSystem _popupSystem = default!; [Dependency] private readonly IPrototypeManager _prototype = default!; [Dependency] private readonly GameTicker _gameTicker = default!; + [Dependency] private readonly MobStateSystem _mobState = default!; private ISharedSponsorsManager? _sponsorsManager; // Sunrise-Sponsors @@ -669,6 +671,11 @@ private void OnMindRemoved(EntityUid uid, GhostTakeoverAvailableComponent compon if (!ghostRole.ReregisterOnGhost || component.LifeStage > ComponentLifeStage.Running) return; + // Sunrise-Start + if (!_mobState.IsAlive(uid)) + return; + // Sunrise-End + ghostRole.Taken = false; RegisterGhostRole((uid, ghostRole)); }