Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when starting game with null map #667

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

11EJDE11
Copy link
Contributor

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 within WriteSpawnIni at the if (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.

            ClearReadyStatuses();
            CopyPlayerDataToUI();
            UpdateDiscordPresence(true);

Not sure which is best or preferred.

Copy link

Nightly build for this pull request:

@@ -1258,6 +1258,12 @@ private void NonHostLaunchGame(string sender, string message)
if (sender != hostName)
return;

if (Map == null)
{
GameProcessExited();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whenever this line is executed, does it always mean the game process is exited? If not, even if the implementation is the same, we should not call such a method. I suggest you made another method, something like HandleNullMap() or something

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants