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>
This commit is contained in:
@@ -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))
|
||||
{
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user