]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add cvar to disable ghosting killing your crit mob (#28945)
authorDrSmugleaf <10968691+DrSmugleaf@users.noreply.github.com>
Sun, 16 Jun 2024 11:21:16 +0000 (04:21 -0700)
committerGitHub <noreply@github.com>
Sun, 16 Jun 2024 11:21:16 +0000 (21:21 +1000)
* 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>
Content.Server/GameTicking/GameTicker.GamePreset.cs
Content.Shared/CCVar/CCVars.cs

index fffacb59dee1511881732a38f3ca5ff299b0dbdd..6e297789528d2e32329379bc57b8b843c5a5f776 100644 (file)
@@ -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))
                 {
index 886ace654dbab6f71b89cc3ab667c34e4bd58ede..7cc1b341a97533b494289ea58e586e4f0c2025df 100644 (file)
@@ -1948,6 +1948,12 @@ namespace Content.Shared.CCVar
         public static readonly CVarDef<float> GhostRoleTime =
             CVarDef.Create("ghost.role_time", 3f, CVar.REPLICATED | CVar.SERVER);
 
+        /// <summary>
+        /// Whether or not to kill the player's mob on ghosting, when it is in a critical health state.
+        /// </summary>
+        public static readonly CVarDef<bool> GhostKillCrit =
+            CVarDef.Create("ghost.kill_crit", true, CVar.REPLICATED | CVar.SERVER);
+
         /*
          * Fire alarm
          */