* 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>
// (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))
{
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
*/