Skip to content

Commit

Permalink
Fix starting a match on the current map first thing
Browse files Browse the repository at this point in the history
  • Loading branch information
VirxEC committed Aug 14, 2024
1 parent 69705e9 commit 62afb75
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions RLBotCS/ManagerTools/MatchStarter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public void StartMatch(MatchSettingsT matchSettings)
public void MapSpawned()
{
Logger.LogInformation("Got map info");
_hasEverLoadedMap = true;

if (!_needsSpawnCars)
return;
Expand Down Expand Up @@ -186,12 +187,10 @@ private void LoadMatch(MatchSettingsT matchSettings)
};

_needsSpawnCars = true;
_matchSettings = null;
_deferredMatchSettings = null;

if (shouldSpawnNewMap)
{
_hasEverLoadedMap = true;
_matchSettings = null;
_deferredMatchSettings = matchSettings;

bridge.TryWrite(new SpawnMap(matchSettings));
Expand All @@ -211,6 +210,10 @@ private void LoadMatch(MatchSettingsT matchSettings)

if (toDespawn.Count > 0)
{
Logger.LogInformation(
"Despawning old players: "
+ string.Join(", ", toDespawn)
);
bridge.TryWrite(new RemoveOldPlayers(toDespawn));
}
}
Expand All @@ -220,6 +223,7 @@ private void LoadMatch(MatchSettingsT matchSettings)
bridge.TryWrite(new FlushMatchCommands());

_matchSettings = matchSettings;
_deferredMatchSettings = null;
}
}

Expand Down

0 comments on commit 62afb75

Please sign in to comment.