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

Finally game restart works

# Conflicts:
#	lib/CGameState.cpp
#	server/CVCMIServer.cpp
This commit is contained in:
nordsoft
2022-09-29 21:08:05 +04:00
parent cbfa125085
commit fea05a4320
9 changed files with 70 additions and 4 deletions

View File

@ -93,12 +93,21 @@ void LobbyGuiAction::applyOnLobbyScreen(CLobbyScreen * lobby, CServerHandler * h
}
}
bool LobbyStartGame::applyOnLobbyHandler(CServerHandler * handler)
bool LobbyEndGame::applyOnLobbyHandler(CServerHandler * handler)
{
if(handler->state == EClientState::GAMEPLAY)
{
handler->endGameplay(false, true);
handler->endGameplay(closeConnection, restart);
}
if(restart)
handler->sendStartGame();
return true;
}
bool LobbyStartGame::applyOnLobbyHandler(CServerHandler * handler)
{
handler->state = EClientState::STARTING;
if(handler->si->mode != StartInfo::LOAD_GAME)
{