1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Do not create main menu UI for game restart (#462)

This commit is contained in:
Dydzio
2018-07-18 23:58:38 +02:00
committed by ArseniyShestakov
parent 84be667363
commit e4a9ce3efe
3 changed files with 13 additions and 10 deletions

View File

@ -478,7 +478,7 @@ void CServerHandler::startGameplay()
state = EClientState::GAMEPLAY;
}
void CServerHandler::endGameplay(bool closeConnection)
void CServerHandler::endGameplay(bool closeConnection, bool restart)
{
client->endGame();
vstd::clear_pointer(client);
@ -490,14 +490,17 @@ void CServerHandler::endGameplay(bool closeConnection)
CSH->sendClientDisconnecting();
logNetwork->info("Closed connection.");
}
if(CMM)
if(!restart)
{
GH.curInt = CMM;
CMM->enable();
}
else
{
GH.curInt = CMainMenu::create();
if(CMM)
{
GH.curInt = CMM;
CMM->enable();
}
else
{
GH.curInt = CMainMenu::create();
}
}
}