Skip to content

Commit

Permalink
Fix initial match start
Browse files Browse the repository at this point in the history
Don't flush match commands, wait!
  • Loading branch information
VirxEC committed Aug 11, 2024
1 parent d75b805 commit df88b17
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions RLBotCS/ManagerTools/MatchStarter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ int rlbotSocketsPort
private bool _communicationStarted;
private bool _hasEverLoadedMap;
private bool _needsSpawnCars;
private bool _mapLoaded;

public bool MatchEnded = false;

Expand Down Expand Up @@ -68,10 +67,6 @@ public void MapSpawned()
if (!_needsSpawnCars)
return;

Logger.LogInformation("Setting mapLoaded to true");

_mapLoaded = true;

if (_deferredMatchSettings is MatchSettingsT matchSettings)
{
bridge.TryWrite(new SetMutators(matchSettings.MutatorSettings));
Expand All @@ -82,7 +77,6 @@ public void MapSpawned()

_matchSettings = matchSettings;
_deferredMatchSettings = null;
bridge.TryWrite(new FlushMatchCommands());
}
}

Expand Down Expand Up @@ -196,7 +190,6 @@ private void LoadMatch(MatchSettingsT matchSettings)

if (shouldSpawnNewMap)
{
_mapLoaded = false;
_hasEverLoadedMap = true;
_deferredMatchSettings = matchSettings;

Expand Down Expand Up @@ -404,15 +397,12 @@ public void IncrementConnectionReadies()
+ _expectedConnections
+ "; needs spawn cars: "
+ _needsSpawnCars
+ "; map loaded: "
+ _mapLoaded
);

if (
_deferredMatchSettings is MatchSettingsT matchSettings
&& _connectionReadies >= _expectedConnections
&& _needsSpawnCars
&& _mapLoaded
)
{
bool needsFlush = SpawnCars(matchSettings);
Expand All @@ -421,8 +411,6 @@ _deferredMatchSettings is MatchSettingsT matchSettings

_matchSettings = matchSettings;
_deferredMatchSettings = null;

bridge.TryWrite(new FlushMatchCommands());
}
}
}

0 comments on commit df88b17

Please sign in to comment.