1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00

Fix all common victory/defeat crashes

This commit is contained in:
Dydzio 2019-06-08 16:59:04 +02:00
parent 6c64356e48
commit 492d6504b4

View File

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