From 4010978a910ac6cc3301543634e9e58fe20b9399 Mon Sep 17 00:00:00 2001 From: mateuszb Date: Wed, 19 Sep 2012 17:41:22 +0000 Subject: [PATCH] * a bit of work on campaigns --- client/CMT.cpp | 8 ++++---- lib/CCampaignHandler.cpp | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/client/CMT.cpp b/client/CMT.cpp index a3c0fb51b..80587b77c 100644 --- a/client/CMT.cpp +++ b/client/CMT.cpp @@ -774,12 +774,12 @@ static void listenForEvents() }*/ case RETURN_TO_MAIN_MENU: { - auto mode = client->getStartInfo()->mode; - endGame(); - if(mode == StartInfo::CAMPAIGN) - GH.pushInt( new CBonusSelection(NULL) ); + StartInfo si = *client->getStartInfo(); + if(si.mode == StartInfo::CAMPAIGN) + GH.pushInt( new CBonusSelection(si.campSt) ); else { + endGame(); CGPreGame::create(); GH.curInt = CGP; GH.defActionsDef = 63; diff --git a/lib/CCampaignHandler.cpp b/lib/CCampaignHandler.cpp index 3ad05066e..203d17020 100644 --- a/lib/CCampaignHandler.cpp +++ b/lib/CCampaignHandler.cpp @@ -410,6 +410,7 @@ void CCampaignState::initNewCampaign( const StartInfo &si ) { assert(si.mode == StartInfo::CAMPAIGN); campaignName = si.mapname; + currentMap = si.campSt->currentMap; camp = CCampaignHandler::getCampaign(campaignName); for (ui8 i = 0; i < camp->mapPieces.size(); i++)