From 4fac0d3ff1214a70abd5ae37edb94334f5ba6cbf Mon Sep 17 00:00:00 2001 From: Vigers Ray Date: Sat, 14 Dec 2024 21:25:55 +0300 Subject: [PATCH] =?UTF-8?q?=D1=84=D0=B8=D0=BA=D1=81=20=D0=B4=D1=83=D0=B1?= =?UTF-8?q?=D0=BB=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=B4?= =?UTF-8?q?=D0=BE=D1=85=D0=BB=D1=8B=D1=85=20=D1=80=D0=BE=D0=BB=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Server/Ghost/Roles/GhostRoleSystem.cs | 7 +++++++ 1 file changed, 7 insertions(+) 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)); }