1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Since filename extensions are omitted, GARRISON.TXT was hiding GARRISON.BMP. I've added a crude workaround (ignore the first file since it's not used).

Fixed #613.
This commit is contained in:
Michał W. Urbańczyk
2010-10-31 21:29:39 +00:00
parent a346708398
commit 5004c1188b
3 changed files with 9 additions and 5 deletions

View File

@@ -2921,18 +2921,19 @@ void CBattleInterface::activateStack()
{ {
activeStack = stackToActivate; activeStack = stackToActivate;
stackToActivate = -1; stackToActivate = -1;
const CStack *s = LOCPLINT->cb->battleGetStackByID(activeStack);
myTurn = true; myTurn = true;
if(attackerInt && defenderInt) //hotseat -> need to pick which interface "takes over" as active 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(); queue->update();
redrawBackgroundWithHexes(activeStack); 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 //block cast spell button if hero doesn't have a spellbook
bSpell->block(!curInt->cb->battleCanCastSpell()); bSpell->block(!curInt->cb->battleCanCastSpell());
bSurrender->block(!curInt->cb->battleCanFlee()); bSurrender->block((curInt == attackerInt ? defendingHeroInstance : attackingHeroInstance) == NULL);
bFlee->block(!curInt->cb->battleCanFlee()); bFlee->block(!curInt->cb->battleCanFlee());
GH.fakeMouseMove(); GH.fakeMouseMove();

View File

@@ -385,7 +385,7 @@ private:
CBattleHero * attackingHero, * defendingHero; //fighting heroes CBattleHero * attackingHero, * defendingHero; //fighting heroes
CStackQueue *queue; CStackQueue *queue;
CCreatureSet army1, army2; //copy of initial armies (for result window) 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, 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 * > idToProjectile; //projectiles of creatures (creatureID, defhandler)
std::map< int, CDefHandler * > idToObstacle; //obstacles located on the battlefield std::map< int, CDefHandler * > idToObstacle; //obstacles located on the battlefield

View File

@@ -243,6 +243,9 @@ void CLodHandler::init(std::string lodFile, std::string dirName)
std::transform(entry.nameStr.begin(), entry.nameStr.end(), std::transform(entry.nameStr.begin(), entry.nameStr.end(),
entry.nameStr.begin(), toupper); 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('.'); size_t dotPos = entry.nameStr.find_last_of('.');
if ( dotPos < entry.nameStr.size() ) if ( dotPos < entry.nameStr.size() )
{ {