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

Multiplayer: threat disconnected player just like if he lost

Now even if player disconnected on it's own turn game will continue.
This commit is contained in:
Arseniy Shestakov 2016-11-04 01:06:10 +03:00
parent db5a52a0f8
commit 9b867808a7

View File

@ -1098,6 +1098,14 @@ void CGameHandler::handleConnection(std::set<PlayerColor> players, CConnection &
assert(!c.connected); //make sure that connection has been marked as broken
logGlobal->error(e.what());
conns -= &c;
for(auto playerConn : connections)
{
if(playerConn.second == &c)
{
gs->getPlayer(playerConn.first)->enteredLosingCheatCode = 1;
checkVictoryLossConditionsForPlayer(playerConn.first);
}
}
}
catch(...)
{