From 29e1f2a0b8e7257f444c7aa74929253a579bbcf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20W=2E=20Urba=C5=84czyk?= Date: Wed, 10 Jun 2009 19:44:09 +0000 Subject: [PATCH] * removed redundant code for displaying map difficulty * bumped version name to 0.72b * more diagnostics in music handler (should help to catch the reported bug with not playing main menu theme) * probably fixed problems with horde buildings in towns that start with upgraded dwellings (0.72#1 http://vcmi.antypika.aplus.pl/forum/viewtopic.php?t=159) --- client/CPreGame.cpp | 36 ++++-------------------------------- global.h | 2 +- hch/CGeneralTextHandler.cpp | 5 +++-- hch/CMusicHandler.cpp | 28 ++++++++++++++++++++++------ hch/CMusicHandler.h | 2 ++ lib/map.cpp | 8 ++++---- 6 files changed, 36 insertions(+), 45 deletions(-) diff --git a/client/CPreGame.cpp b/client/CPreGame.cpp index e857aff03..6363480b3 100644 --- a/client/CPreGame.cpp +++ b/client/CPreGame.cpp @@ -1420,25 +1420,10 @@ void MapSel::printSelectedInfo() if (selMap.name.length()) CSDL_Ext::printAt(selMap.name,420,41,GEORXX); else CSDL_Ext::printAt("Unnamed",420,41,GEORXX); - std::string diff; - switch (selMap.difficulty) - { - case 0: - diff=gdiff(CGI->generaltexth->zelp[24].second); - break; - case 1: - diff=gdiff(CGI->generaltexth->zelp[25].second); - break; - case 2: - diff=gdiff(CGI->generaltexth->zelp[26].second); - break; - case 3: - diff=gdiff(CGI->generaltexth->zelp[27].second); - break; - case 4: - diff=gdiff(CGI->generaltexth->zelp[28].second); - break; - } + + assert(selMap.difficulty <= 4); + std::string &diff = CGI->generaltexth->arraytxt[142 + selMap.difficulty]; + temp=-1; switch (selMap.width) { @@ -1512,19 +1497,6 @@ void MapSel::printFlags() } } } - -std::string MapSel::gdiff(std::string ss) -{ - std::string ret; - for (int i=1;i convertBuildings(const std::set h3m, int castleID) else ret.insert(19); } - else - { + //else + //{ if(((castleID==1) || (castleID==3)) && ((level==3) || (level==5))) ret.insert(24); else ret.insert(18); - } + //} } else { @@ -746,7 +746,7 @@ void Mapa::loadTown( CGObjectInstance * &nobj, unsigned char * bufor, int &i ) if(readChar(bufor,i))//true if garrison isn't empty nt->army = readCreatureSet(bufor,i,7,(version>RoE)); nt->army.formation = bufor[i]; ++i; - if(readChar(bufor,i)) //unusualBuildings + if(readChar(bufor,i)) //custom buildings info { //built buildings for(int byte=0;byte<6;byte++)