diff --git a/client/CCastleInterface.cpp b/client/CCastleInterface.cpp index 508c2332e..b72c67445 100644 --- a/client/CCastleInterface.cpp +++ b/client/CCastleInterface.cpp @@ -1141,6 +1141,35 @@ void CCastleInterface::keyPressed( const SDL_KeyboardEvent & key ) switch(key.keysym.sym) { +#if 0 // code that can be used to fix blit order in towns using +/- keys. Quite ugly but works + case SDLK_KP_PLUS : + if (builds->selectedBuilding) + { + OBJ_CONSTRUCTION_CAPTURING_ALL; + CStructure * str = const_cast(builds->selectedBuilding->str); + str->pos.z++; + delete builds; + builds = new CCastleBuildings(town); + + BOOST_FOREACH(const CStructure * str, town->town->clientInfo.structures) + tlog1 << int(str->building->bid) << " -> " << int(str->pos.z) << "\n"; + } + break; + case SDLK_KP_MINUS: + if (builds->selectedBuilding) + { + OBJ_CONSTRUCTION_CAPTURING_ALL; + CStructure * str = const_cast(builds->selectedBuilding->str); + str->pos.z--; + delete builds; + builds = new CCastleBuildings(town); + + BOOST_FOREACH(const CStructure * str, town->town->clientInfo.structures) + tlog1 << int(str->building->bid) << " -> " << int(str->pos.z) << "\n"; + + } + break; +#endif case SDLK_UP: townlist->selectPrev(); break; diff --git a/client/GUIClasses.cpp b/client/GUIClasses.cpp index 99897556e..daac4484c 100644 --- a/client/GUIClasses.cpp +++ b/client/GUIClasses.cpp @@ -1386,6 +1386,7 @@ void CRecruitmentWindow::select(CCreatureCard *card) totalCostValue->createItems(card->creature->cost); costPerTroopValue->set(card->creature->cost); + totalCostValue->set(card->creature->cost * maxAmount); //Recruit %s title->setTxt(boost::str(boost::format(CGI->generaltexth->tcommands[21]) % card->creature->namePl)); diff --git a/lib/CGameState.cpp b/lib/CGameState.cpp index 6a1bf776c..be2f22211 100644 --- a/lib/CGameState.cpp +++ b/lib/CGameState.cpp @@ -636,7 +636,12 @@ std::pair CGameState::pickObject (CGObjectInstance *obj) result = std::pair(17, iter.first); if (result.first == -1) + { tlog0 << "Error: failed to find creature for dwelling of "<< int(faction) << " of level " << int(level) << "\n"; + auto iter = VLC->objh->cregens.begin(); + std::advance(iter, ran() % VLC->objh->cregens.size() ); + result = std::pair(17, iter->first); + } return result; } diff --git a/server/CGameHandler.cpp b/server/CGameHandler.cpp index dea8a999d..fb1e34c81 100644 --- a/server/CGameHandler.cpp +++ b/server/CGameHandler.cpp @@ -2506,7 +2506,7 @@ bool CGameHandler::buildStructure( si32 tid, si32 bid, bool force /*=false*/ ) FoWChange fw; fw.player = t->tempOwner; fw.mode = 1; - getTilesInRange(fw.tiles,t->pos,t->getSightRadious(),t->tempOwner,1); + t->getSightTiles(fw.tiles); sendAndApply(&fw); if (!force) @@ -3815,9 +3815,9 @@ void CGameHandler::playerMessage( ui8 player, const std::string &message ) SetResources sr; sr.player = player; sr.res = gs->getPlayer(player)->resources; - for(int i=0;i<7;i++) + for(int i=0;i