From 01105ddc41795a2818526d731e76708f8e4f65ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20W=2E=20Urba=C5=84czyk?= Date: Mon, 1 Sep 2008 00:25:36 +0000 Subject: [PATCH] * fixed move hero button * creatures placeholders work properly * abandoned mine won't show message with mithril * it's possible to build glyph of fear in fortress * emissaries won't be used in random creature drawing (they have no correct def) * fixed problem with moving two-hex creatures one tile back --- CAdvmapInterface.cpp | 2 ++ CGameState.cpp | 13 ++++++++++++- CLua.cpp | 2 ++ ChangeLog | 5 ++++- config/hall.txt | 2 +- hch/CCreatureHandler.cpp | 5 +++-- server/CGameHandler.cpp | 2 +- 7 files changed, 25 insertions(+), 6 deletions(-) diff --git a/CAdvmapInterface.cpp b/CAdvmapInterface.cpp index cc8acd8bb..e185faf95 100644 --- a/CAdvmapInterface.cpp +++ b/CAdvmapInterface.cpp @@ -995,7 +995,9 @@ void CAdvMapInt::fmoveHero() if (!terrain.currentPath) return; CPath sended(*(terrain.currentPath)); //temporary path - engine will operate on it + LOCPLINT->pim->unlock(); LOCPLINT->cb->moveHero( ((const CGHeroInstance*)LOCPLINT->adventureInt->selection)->type->ID,&sended,1,0); + LOCPLINT->pim->lock(); } void CAdvMapInt::fshowSpellbok() { diff --git a/CGameState.cpp b/CGameState.cpp index 5b76fc0f5..204b4cdcd 100644 --- a/CGameState.cpp +++ b/CGameState.cpp @@ -1131,7 +1131,18 @@ void CGameState::init(StartInfo * si, Mapa * map, int Seed) vti->spells[s->level-1].push_back(s->id); vti->possibleSpells -= s->id; } - + + //init garrisons + for (std::map >::iterator j=vti->army.slots.begin(); j!=vti->army.slots.end();j++) + { + if(j->second.first > 196 && j->second.first < 211) + { + if(j->second.first%2) + j->second.first = vti->town->basicCreatures[ (j->second.first-197) / 2 ]; + else + j->second.first = vti->town->upgradedCreatures[ (j->second.first-197) / 2 ]; + } + } players[vti->getOwner()].towns.push_back(vti); } diff --git a/CLua.cpp b/CLua.cpp index b988583d5..8de4fc40c 100644 --- a/CLua.cpp +++ b/CLua.cpp @@ -514,6 +514,8 @@ void CMines::onHeroVisit(int objid, int heroID) { //TODO: this is code for standard mines, no support for abandoned mine (subId==7) DEFOS; + if(os->subID==7) + return; const CGHeroInstance *h = cb->getHero(heroID); if(h->tempOwner == os->tempOwner) return; //TODO: leaving garrison diff --git a/ChangeLog b/ChangeLog index dcff8ce06..b52560ddc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -0.61 -> 0.62 (Aug 31 2008 hopefully) +0.61 -> 0.62 (Sep 01 2008) General: * restructured to the server-client model * support for heroes placed in towns @@ -19,6 +19,8 @@ Castles: * mage guild screen * support for blacksmith * if hero doesn't have a spell book, he can buy one in a mage guild +* it's possible to build glyph of fear in fortress +* creatures placeholders work properly Adventure Interface: * hopefully fixed problems with wrong town defs (village/fort/capitol) @@ -38,6 +40,7 @@ Battles: * slightly optimized showing of battle interface * animation of getting hit / death by shooting is displayed when it should be * improved pathfinding in battles, removed problems with displaying movement, adventure map interface won't be called during battles. +* minor optimizations PreGame: * updates settings when selecting new map after changing sorting criteria diff --git a/config/hall.txt b/config/hall.txt index bc58e1a32..260d092d3 100644 --- a/config/hall.txt +++ b/config/hall.txt @@ -52,7 +52,7 @@ TPTHBKTW.BMP TPTHBKFR.BMP 10 11 12 13 | 7 8 9 | 5 | 16 14 15 | 0 1 2 | 6 -17 | 22 | 18 19 +17 | 21 22 | 18 19 30 37 | 31 38 | 32 39 | 33 40 34 41 | 35 42 | 36 43 8 diff --git a/hch/CCreatureHandler.cpp b/hch/CCreatureHandler.cpp index fed96081b..dacfb1ed6 100644 --- a/hch/CCreatureHandler.cpp +++ b/hch/CCreatureHandler.cpp @@ -63,7 +63,7 @@ si32 CCreature::maxAmount(const std::vector &res) const //how many creatur void CCreatureHandler::loadCreatures() { - notUsedMonsters += 122,124,126,128,145,146,147,148,149,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191; + notUsedMonsters += 122,124,126,128,145,146,147,148,149,160,161,162,163,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191; std::string buf = bitmaph->getTextFile("ZCRTRAIT.TXT"); int andame = buf.size(); int i=0; //buf iterator @@ -443,7 +443,8 @@ void CCreatureHandler::loadCreatures() } inp2.close(); - creatures[123].abilityRefs += "DOUBLE_WIDE"; + creatures[122].abilityRefs += "DOUBLE_WIDE"; //water elemental should be treated as double-wide + creatures[123].abilityRefs += "DOUBLE_WIDE"; //ice elemental should be treated as double-wide } void CCreatureHandler::loadAnimationInfo() diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 4b7cfbf4e..3a0cacc1a 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -921,7 +921,7 @@ void CGameHandler::moveStack(int stack, int dest) else gs->curB->getAccessibilityMap(accessibility,curStack->ID); - if((stackAtEnd && stackAtEnd->alive) || !accessibility[dest]) + if((stackAtEnd && stackAtEnd!=curStack && stackAtEnd->alive) || !accessibility[dest]) return; //if(dists[dest] > curStack->creature->speed && !(stackAtEnd && dists[dest] == curStack->creature->speed+1)) //we can attack a stack if we can go to adjacent hex