1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Merge pull request #605 from vcmi/VictoryDefeatCrashFix

Fix all common victory/defeat crashes
This commit is contained in:
Alexander Shishkin
2019-06-08 21:54:48 +03:00
committed by GitHub

View File

@@ -2175,11 +2175,13 @@ void CPlayerInterface::gameOver(PlayerColor player, const EVictoryLossCheckResul
if (victoryLossCheckResult.victory() && LOCPLINT == this)
{
// end game if current human player has won
CSH->sendClientDisconnecting();
requestReturningToMainMenu(true);
}
else if(CSH->howManyPlayerInterfaces() == 1 && !settings["session"]["spectate"].Bool())
{
//all human players eliminated
CSH->sendClientDisconnecting();
requestReturningToMainMenu(false);
}