1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

- Fixed starting another map from campaign bonus selection screen while playing a campaign mission

This commit is contained in:
beegee1
2013-12-17 12:12:25 +00:00
parent b9b25ef552
commit d1002f7e8f
3 changed files with 87 additions and 37 deletions

View File

@@ -89,6 +89,7 @@ void playIntro();
static void listenForEvents();
//void requestChangingResolution();
void startGame(StartInfo * options, CConnection *serv = nullptr);
void endGame();
#ifndef _WIN32
#ifndef _GNU_SOURCE
@@ -856,17 +857,6 @@ static void listenForEvents()
}
else if(ev.type == SDL_USEREVENT)
{
auto endGame = []
{
client->endGame();
vstd::clear_pointer(client);
delete CGI->dobjinfo.get();
const_cast<CGameInfo*>(CGI)->dobjinfo = new CDefObjInfoHandler;
const_cast<CGameInfo*>(CGI)->modh->reload(); //add info about new creatures to dobjinfo
};
switch(ev.user.code)
{
case RETURN_TO_MAIN_MENU:
@@ -954,6 +944,17 @@ void startGame(StartInfo * options, CConnection *serv/* = nullptr*/)
client->connectionHandler = new boost::thread(&CClient::run, client);
}
void endGame()
{
client->endGame();
vstd::clear_pointer(client);
delete CGI->dobjinfo.get();
const_cast<CGameInfo*>(CGI)->dobjinfo = new CDefObjInfoHandler;
const_cast<CGameInfo*>(CGI)->modh->reload(); //add info about new creatures to dobjinfo
}
void handleQuit()
{
auto quitApplication = []()