Skip to content

Commit

Permalink
Add MatchEnded to Restart_If_Different's shouldSpawnNewMap
Browse files Browse the repository at this point in the history
  • Loading branch information
VirxEC committed Aug 12, 2024
1 parent fe27399 commit 2c70a5b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions RLBotCS/ManagerTools/MatchStarter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
};

Expand Down Expand Up @@ -292,6 +292,7 @@ private bool SpawnCars(MatchSettingsT matchSettings, bool force = false)
return false;

bool doSpawning =
force ||
matchSettings.AutoStartBots
&& _expectedConnections != 0
&& _expectedConnections <= _connectionReadies;
Expand Down Expand Up @@ -402,8 +403,8 @@ _deferredMatchSettings is MatchSettingsT matchSettings
&& _needsSpawnCars
)
{
bool needsFlush = SpawnCars(matchSettings);
if (!needsFlush)
bool spawned = SpawnCars(matchSettings);
if (!spawned)
return;

_matchSettings = matchSettings;
Expand Down

0 comments on commit 2c70a5b

Please sign in to comment.