mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Fixes and cleanup of game client network shutdown and restart
This commit is contained in:
@@ -445,7 +445,10 @@ void CGameHandler::changeSecSkill(const CGHeroInstance * hero, SecondarySkill wh
|
||||
void CGameHandler::handleClientDisconnection(std::shared_ptr<CConnection> c)
|
||||
{
|
||||
if(lobby->getState() == EServerState::SHUTDOWN || !gs || !gs->scenarioOps)
|
||||
{
|
||||
assert(0); // game should have shut down before reaching this point!
|
||||
return;
|
||||
}
|
||||
|
||||
for(auto & playerConnections : connections)
|
||||
{
|
||||
@@ -3609,7 +3612,7 @@ void CGameHandler::checkVictoryLossConditionsForPlayer(PlayerColor player)
|
||||
|
||||
if(p->human)
|
||||
{
|
||||
lobby->setState(EServerState::GAMEPLAY_ENDED);
|
||||
lobby->setState(EServerState::SHUTDOWN);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user