Fix crash when starting game with null map #667
+13
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This issue occurs when all players are marked as Ready, and the host quickly switches to a map that some players don't have before clicking Start. Players missing the map will crash.
The crash happens in
GameLobbyBase.cs
withinWriteSpawnIni
at theif (Map.IsCoop)
check. This fix prevents the game reaching that line with a null map.GameProcessExited is called to inform the host that the player has left the game. Without this, the host would still consider the player as IsInGame which would cause issues (I think) similar to #641.
The match statistics changes are because GameProcessExited calls them which won't work with a null map.
If it's preferred, instead of calling GameProcessExited and making changes to match statistics, we could just call the relevant lines of GameProcessExited directly.
Not sure which is best or preferred.