diff --git a/client/CBattleInterface.cpp b/client/CBattleInterface.cpp index 3083bd63c..f9416797f 100644 --- a/client/CBattleInterface.cpp +++ b/client/CBattleInterface.cpp @@ -2921,18 +2921,19 @@ void CBattleInterface::activateStack() { activeStack = stackToActivate; stackToActivate = -1; + const CStack *s = LOCPLINT->cb->battleGetStackByID(activeStack); myTurn = true; if(attackerInt && defenderInt) //hotseat -> need to pick which interface "takes over" as active - curInt = attackerInt->playerID == LOCPLINT->cb->battleGetStackByID(activeStack)->owner ? attackerInt : defenderInt; + curInt = attackerInt->playerID == s->owner ? attackerInt : defenderInt; queue->update(); redrawBackgroundWithHexes(activeStack); - bWait->block(vstd::contains(curInt->cb->battleGetStackByID(activeStack)->state, WAITING)); //block waiting button if stack has been already waiting + bWait->block(vstd::contains(s->state, WAITING)); //block waiting button if stack has been already waiting //block cast spell button if hero doesn't have a spellbook bSpell->block(!curInt->cb->battleCanCastSpell()); - bSurrender->block(!curInt->cb->battleCanFlee()); + bSurrender->block((curInt == attackerInt ? defendingHeroInstance : attackingHeroInstance) == NULL); bFlee->block(!curInt->cb->battleCanFlee()); GH.fakeMouseMove(); diff --git a/client/CBattleInterface.h b/client/CBattleInterface.h index b45e07809..3b0f25850 100644 --- a/client/CBattleInterface.h +++ b/client/CBattleInterface.h @@ -385,7 +385,7 @@ private: CBattleHero * attackingHero, * defendingHero; //fighting heroes CStackQueue *queue; CCreatureSet army1, army2; //copy of initial armies (for result window) - CGHeroInstance * attackingHeroInstance, * defendingHeroInstance; + const CGHeroInstance * attackingHeroInstance, * defendingHeroInstance; std::map< int, CCreatureAnimation * > creAnims; //animations of creatures from fighting armies (order by BattleInfo's stacks' ID) std::map< int, CDefHandler * > idToProjectile; //projectiles of creatures (creatureID, defhandler) std::map< int, CDefHandler * > idToObstacle; //obstacles located on the battlefield diff --git a/hch/CLodHandler.cpp b/hch/CLodHandler.cpp index 07dcdf814..094a7f48c 100644 --- a/hch/CLodHandler.cpp +++ b/hch/CLodHandler.cpp @@ -242,7 +242,10 @@ void CLodHandler::init(std::string lodFile, std::string dirName) //format string: upper-case, remove extension std::transform(entry.nameStr.begin(), entry.nameStr.end(), entry.nameStr.begin(), toupper); - + + if(entry.nameStr == "GARRISON.TXT") //crude workaround -> there are both GARRISON.TXT and GARRSION.BMP, since we ommit extensions, first one (not used by VCMI) would overwrite the second + continue; + size_t dotPos = entry.nameStr.find_last_of('.'); if ( dotPos < entry.nameStr.size() ) {