Separate game rule enabling and game rule starting (#6168)

This commit is contained in:
mirrorcult
2022-02-15 20:06:28 -07:00
committed by GitHub
parent e427381be6
commit 3abc7a443e
13 changed files with 125 additions and 52 deletions

View File

@@ -71,6 +71,8 @@ namespace Content.Server.GameTicking
private void PreRoundSetup()
{
AddGamePresetRules();
DefaultMap = _mapManager.CreateMap();
_pauseManager.AddUninitializedMap(DefaultMap);
_startingRound = false;
@@ -188,7 +190,7 @@ namespace Content.Server.GameTicking
SendServerMessage(Loc.GetString("game-ticker-start-round"));
AddGamePresetRules();
StartGamePresetRules();
List<IPlayerSession> readyPlayers;
if (LobbyEnabled)
@@ -246,6 +248,7 @@ namespace Content.Server.GameTicking
ClearGameRules();
SetGamePreset(_configurationManager.GetCVar(CCVars.GameLobbyFallbackPreset));
AddGamePresetRules();
StartGamePresetRules();
startAttempt.Uncancel();
RaiseLocalEvent(startAttempt);
@@ -508,7 +511,7 @@ namespace Content.Server.GameTicking
// Clear up any game rules.
ClearGameRules();
_gameRules.Clear();
_addedGameRules.Clear();
// Round restart cleanup event, so entity systems can reset.
var ev = new RoundRestartCleanupEvent();