diff --git a/client/AdventureMapButton.cpp b/client/AdventureMapButton.cpp index 795a82a8e..4d670d9ab 100644 --- a/client/AdventureMapButton.cpp +++ b/client/AdventureMapButton.cpp @@ -126,11 +126,15 @@ void AdventureMapButton::clickLeft(tribool down, bool previousState) { if(blocked) return; - if (down) { + + if (down) + { CGI->soundh->playSound(soundBase::button); state=1; - } else + } + else state=0; + show(screenBuf); if (actOnDown && down) { @@ -201,25 +205,6 @@ void AdventureMapButton::hover (bool on) } } -//void AdventureMapButton::activate() -//{ -//// if (active) return; -//// active=true; -// activateLClick(); -// activateRClick(); -// activateHover(); -// activateKeys(); -//} -//void AdventureMapButton::deactivate() -//{ -//// if (!active) return; -//// active=false; -// deactivateLClick(); -// deactivateRClick(); -// deactivateHover(); -// deactivateKeys(); -//} - void AdventureMapButton::init(const CFunctionList &Callback, const std::map &Name, const std::string &HelpBox, bool playerColoredButton, const std::string &defName, std::vector * add, int x, int y, int key) { used = LCLICK | RCLICK | HOVER | KEYBOARD; diff --git a/client/CHeroWindow.cpp b/client/CHeroWindow.cpp index 9ac4dd2ad..821617e61 100644 --- a/client/CHeroWindow.cpp +++ b/client/CHeroWindow.cpp @@ -25,6 +25,8 @@ #include #include +#undef min; + /* * CHeroWindow.cpp, part of VCMI engine * @@ -219,7 +221,7 @@ void CHeroWindow::setHero(const CGHeroInstance *hero) } //secondary skills support - for(size_t g=0; gsecSkills.size(); ++g) + for(size_t g=0; gsecSkills.size()); ++g) { int skill = hero->secSkills[g].first, level = hero->secSkills[g].second; @@ -317,7 +319,7 @@ void CHeroWindow::activate() { primSkillAreas[v]->activate(); } - for(size_t v=0; vsecSkills.size(); ++v) + for(size_t v=0; vsecSkills.size()); ++v) { secSkillAreas[v]->activate(); } @@ -351,7 +353,7 @@ void CHeroWindow::deactivate() { primSkillAreas[v]->deactivate(); } - for(size_t v=0; vsecSkills.size(); ++v) + for(size_t v=0; vsecSkills.size()); ++v) { secSkillAreas[v]->deactivate(); } diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index 419017086..589af4d34 100644 --- a/client/CPlayerInterface.cpp +++ b/client/CPlayerInterface.cpp @@ -1250,6 +1250,8 @@ void CPlayerInterface::tileRevealed(const std::set &pos) boost::unique_lock un(*pim); for(std::set::const_iterator i=pos.begin(); i!=pos.end();i++) adventureInt->minimap.showTile(*i); + if(pos.size()) + GH.totalRedraw(); } void CPlayerInterface::tileHidden(const std::set &pos) diff --git a/hch/CObjectHandler.h b/hch/CObjectHandler.h index be8dc3b4a..e09299f7a 100644 --- a/hch/CObjectHandler.h +++ b/hch/CObjectHandler.h @@ -602,7 +602,7 @@ public: void initObj(); template void serialize(Handler &h, const int version) { - h & static_cast(*this) & static_cast(*this);; + h & static_cast(*this); h & allowedAbilities & ability; } }; @@ -702,7 +702,7 @@ public: template void serialize(Handler &h, const int version) { - h & static_cast(*this) & static_cast(*this);; + h & static_cast(*this);; h & spell; } }; @@ -904,7 +904,7 @@ public: template void serialize(Handler &h, const int version) { - h & static_cast(*this) & static_cast(*this);; + h & static_cast(*this);; h & bonusType & bonusVal; } }; diff --git a/lib/CGameState.cpp b/lib/CGameState.cpp index 6bdbefa50..63a861db6 100644 --- a/lib/CGameState.cpp +++ b/lib/CGameState.cpp @@ -2954,7 +2954,7 @@ void BattleInfo::getStackQueue( std::vector &out, int howMany, i const CStack * const s = stacks[i]; if(turn <= 0 && !s->willMove() //we are considering current round and stack won't move || turn > 0 && !s->canMove(turn) //stack won't be able to move in later rounds - || turn <= 0 && s == active) //it's active stack already added at the beginning of queue + || turn <= 0 && s == active && out.size() && s == out.front()) //it's active stack already added at the beginning of queue { continue; } diff --git a/lib/NetPacksLib.cpp b/lib/NetPacksLib.cpp index d16f05156..e03a30d27 100644 --- a/lib/NetPacksLib.cpp +++ b/lib/NetPacksLib.cpp @@ -657,7 +657,6 @@ DLL_EXPORT void BattleSetActiveStack::applyGs( CGameState *gs ) { gs->curB->activeStack = stack; CStack *st = gs->curB->getStack(stack); - st->state -= WAITING; //if stack was waiting it'll now make move, so it won't be "waiting" anymore if(vstd::contains(st->state,MOVED)) //if stack is moving second time this turn it must had a high morale bonus st->state.insert(HAD_MORALE); } @@ -743,11 +742,13 @@ DLL_EXPORT void StartAction::applyGs( CGameState *gs ) break; case 8: st->state.insert(WAITING); - break; + return; case 2: case 6: case 7: case 9: case 10: case 11: st->state.insert(MOVED); break; } + + st->state -= WAITING; //if stack was waiting it has made move, so it won't be "waiting" anymore (if the action was WAIT, then we have returned) } DLL_EXPORT void SpellCast::applyGs( CGameState *gs ) diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index 4c66aab41..857121478 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -2384,7 +2384,7 @@ bool CGameHandler::buyArtifact( ui32 hid, si32 aid ) if(vstd::contains(hero->artifWorn,ui16(9+aid)) && complain("Hero already has this machine!") || !vstd::contains(town->builtBuildings,si32(16)) && complain("No blackismith!") || gs->getPlayer(hero->getOwner())->resources[6] < price && complain("Not enough gold!") //no gold - || town->town->warMachine!= aid && complain("This machine is unavailale here!") ) //TODO: ballista yard in Stronghold + || town->town->warMachine!= aid && complain("This machine is unavailable here!") ) //TODO: ballista yard in Stronghold { return false; }