Skip to content

Commit

Permalink
Respawn System CVar
Browse files Browse the repository at this point in the history
  • Loading branch information
VMSolidus committed Oct 5, 2024
1 parent 1cc130a commit 1476873
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Content.Server/GameTicking/GameTicker.Spawning.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
15 changes: 9 additions & 6 deletions Content.Shared/CCVar/CCVars.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2509,14 +2509,17 @@ public static readonly CVarDef<float>

#endregion

#region GhostRespawn
#region GhostRespawn

public static readonly CVarDef<double> GhostRespawnTime =
CVarDef.Create("ghost.respawn_time", 15d, CVar.SERVERONLY);
public static readonly CVarDef<double> GhostRespawnTime =
CVarDef.Create("ghost.respawn_time", 15d, CVar.SERVERONLY);

public static readonly CVarDef<int> GhostRespawnMaxPlayers =
CVarDef.Create("ghost.respawn_max_players", 40, CVar.SERVERONLY);
public static readonly CVarDef<int> GhostRespawnMaxPlayers =
CVarDef.Create("ghost.respawn_max_players", 40, CVar.SERVERONLY);

#endregion
public static readonly CVarDef<bool> GhostAllowSameCharacter =
CVarDef.Create("ghost.allow_same_character", false, CVar.SERVERONLY);

#endregion
}
}

0 comments on commit 1476873

Please sign in to comment.