From 2c70a5b73776705d93805f67b8a722a1cd28106c Mon Sep 17 00:00:00 2001 From: VirxEC Date: Mon, 12 Aug 2024 13:58:36 -0400 Subject: [PATCH] Add `MatchEnded` to `Restart_If_Different`'s `shouldSpawnNewMap` --- RLBotCS/ManagerTools/MatchStarter.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/RLBotCS/ManagerTools/MatchStarter.cs b/RLBotCS/ManagerTools/MatchStarter.cs index c613dd4..e5e1998 100644 --- a/RLBotCS/ManagerTools/MatchStarter.cs +++ b/RLBotCS/ManagerTools/MatchStarter.cs @@ -180,7 +180,7 @@ private void LoadMatch(MatchSettingsT matchSettings) var shouldSpawnNewMap = matchSettings.ExistingMatchBehavior switch { ExistingMatchBehavior.Continue_And_Spawn => !_hasEverLoadedMap || MatchEnded, - ExistingMatchBehavior.Restart_If_Different => IsDifferentFromLast(matchSettings), + ExistingMatchBehavior.Restart_If_Different => MatchEnded || IsDifferentFromLast(matchSettings), _ => true }; @@ -292,6 +292,7 @@ private bool SpawnCars(MatchSettingsT matchSettings, bool force = false) return false; bool doSpawning = + force || matchSettings.AutoStartBots && _expectedConnections != 0 && _expectedConnections <= _connectionReadies; @@ -402,8 +403,8 @@ _deferredMatchSettings is MatchSettingsT matchSettings && _needsSpawnCars ) { - bool needsFlush = SpawnCars(matchSettings); - if (!needsFlush) + bool spawned = SpawnCars(matchSettings); + if (!spawned) return; _matchSettings = matchSettings;