From: DrSmugleaf <10968691+DrSmugleaf@users.noreply.github.com> Date: Sun, 16 Jun 2024 11:21:16 +0000 (-0700) Subject: Add cvar to disable ghosting killing your crit mob (#28945) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=4954b6d79e194a4dd8b7f2d9942fa707e259493d;p=space-station-14.git Add cvar to disable ghosting killing your crit mob (#28945) * Add cvar to disable ghosting killing your crit mob * Update Content.Shared/CCVar/CCVars.cs Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com> --------- Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: ShadowCommander <10494922+ShadowCommander@users.noreply.github.com> --- 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 */