diff --git a/Content.Server/GameTicking/GameTicker.GamePreset.cs b/Content.Server/GameTicking/GameTicker.GamePreset.cs index fffacb59de..6e29778952 100644 --- a/Content.Server/GameTicking/GameTicker.GamePreset.cs +++ b/Content.Server/GameTicking/GameTicker.GamePreset.cs @@ -251,7 +251,9 @@ namespace Content.Server.GameTicking // (If the mob survives, that's a bug. Ghosting is kept regardless.) var canReturn = canReturnGlobal && _mind.IsCharacterDeadPhysically(mind); - if (canReturnGlobal && TryComp(playerEntity, out MobStateComponent? mobState)) + if (_configurationManager.GetCVar(CCVars.GhostKillCrit) && + canReturnGlobal && + TryComp(playerEntity, out MobStateComponent? mobState)) { if (_mobState.IsCritical(playerEntity.Value, mobState)) { diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index 886ace654d..7cc1b341a9 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -1948,6 +1948,12 @@ namespace Content.Shared.CCVar public static readonly CVarDef GhostRoleTime = CVarDef.Create("ghost.role_time", 3f, CVar.REPLICATED | CVar.SERVER); + /// + /// Whether or not to kill the player's mob on ghosting, when it is in a critical health state. + /// + public static readonly CVarDef GhostKillCrit = + CVarDef.Create("ghost.kill_crit", true, CVar.REPLICATED | CVar.SERVER); + /* * Fire alarm */