From 147687346797e58908afcbef84befcafd192e818 Mon Sep 17 00:00:00 2001 From: VMSolidus Date: Sat, 5 Oct 2024 19:23:19 -0400 Subject: [PATCH] Respawn System CVar --- Content.Server/GameTicking/GameTicker.Spawning.cs | 2 +- Content.Shared/CCVar/CCVars.cs | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Content.Server/GameTicking/GameTicker.Spawning.cs b/Content.Server/GameTicking/GameTicker.Spawning.cs index c0643d5476..7bbb602457 100644 --- a/Content.Server/GameTicking/GameTicker.Spawning.cs +++ b/Content.Server/GameTicking/GameTicker.Spawning.cs @@ -157,7 +157,7 @@ private void SpawnPlayer(ICommonSession player, HumanoidCharacterProfile charact } //Ghost system return to round, check for whether the character isn't the same. - if (lateJoin && !_adminManager.IsAdmin(player) && !CheckGhostReturnToRound(player, character, out var checkAvoid)) + if (!_cfg.GetCVar(CCVars.GhostAllowSameCharacter) && lateJoin && !_adminManager.IsAdmin(player) && !CheckGhostReturnToRound(player, character, out var checkAvoid)) { var message = checkAvoid ? Loc.GetString("ghost-respawn-same-character-slightly-changed-name") diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index 901c028472..7714122d9f 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -2509,14 +2509,17 @@ public static readonly CVarDef #endregion - #region GhostRespawn + #region GhostRespawn - public static readonly CVarDef GhostRespawnTime = - CVarDef.Create("ghost.respawn_time", 15d, CVar.SERVERONLY); + public static readonly CVarDef GhostRespawnTime = + CVarDef.Create("ghost.respawn_time", 15d, CVar.SERVERONLY); - public static readonly CVarDef GhostRespawnMaxPlayers = - CVarDef.Create("ghost.respawn_max_players", 40, CVar.SERVERONLY); + public static readonly CVarDef GhostRespawnMaxPlayers = + CVarDef.Create("ghost.respawn_max_players", 40, CVar.SERVERONLY); - #endregion + public static readonly CVarDef GhostAllowSameCharacter = + CVarDef.Create("ghost.allow_same_character", false, CVar.SERVERONLY); + + #endregion } }