From f99c4d3c6639b2bce0aa1dc50b9b06d1d5313f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20W=2E=20Urba=C5=84czyk?= Date: Fri, 13 Nov 2009 16:02:25 +0000 Subject: [PATCH] Fixed #110. Some minor changes / fixes. --- client/CBattleInterface.cpp | 1 + client/CCastleInterface.cpp | 7 +++---- client/CHeroWindow.cpp | 1 + client/CSpellWindow.cpp | 2 ++ client/GUIClasses.cpp | 11 ++++++----- client/NetPacksClient.cpp | 3 ++- client/VCMI_client.vcproj | 2 +- lib/CGameState.cpp | 3 ++- lib/VCMIDirs.h | 6 ++++-- lib/VCMI_lib.vcproj | 6 +++++- server/VCMI_server.vcproj | 2 +- 11 files changed, 28 insertions(+), 16 deletions(-) diff --git a/client/CBattleInterface.cpp b/client/CBattleInterface.cpp index c82bb6716..6a4e4b2f3 100644 --- a/client/CBattleInterface.cpp +++ b/client/CBattleInterface.cpp @@ -26,6 +26,7 @@ #include "../hch/CTownHandler.h" #include #include +#include #ifndef __GNUC__ const double M_PI = 3.14159265358979323846; #else diff --git a/client/CCastleInterface.cpp b/client/CCastleInterface.cpp index 9a4af59d4..6e5d6c858 100644 --- a/client/CCastleInterface.cpp +++ b/client/CCastleInterface.cpp @@ -575,7 +575,7 @@ void CCastleInterface::buildingClicked(int building) { if(LOCPLINT->cb->getResourceAmount(6) < 500) //not enough gold to buy spellbook { - LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[213],std::vector(), soundBase::sound_todo); + LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[213]); } else { @@ -594,7 +594,6 @@ void CCastleInterface::buildingClicked(int building) case 5: //tavern { enterTavern(); - break; } case 6: //shipyard @@ -645,7 +644,7 @@ void CCastleInterface::buildingClicked(int building) //TODO: case 18: //basic horde 1 //TODO: case 19: //upg horde 1 case 20: //ship at shipyard - //Do nothing. + LOCPLINT->showInfoDialog(CGI->generaltexth->allTexts[51]); //Cannot build another boat break; //TODO: case 21: //special 2 case 22: //special 3 @@ -916,7 +915,7 @@ void CCastleInterface::recreateBuildings() if(vstd::contains(town->builtBuildings,6)) { std::vector vobjs = LOCPLINT->cb->getVisitableObjs(town->bestLocation()); - if(vobjs.size() && vobjs.front()->ID == 8) //there is visitable obj at shipyard output tile and it's a boat + if(vobjs.size() && (vobjs.front()->ID == 8 || vobjs.front()->ID == HEROI_TYPE)) //there is visitable obj at shipyard output tile and it's a boat or hero (on boat) { Structure * st = CGI->townh->structures[town->subID][20]; buildings.push_back(new CBuildingRect(st)); diff --git a/client/CHeroWindow.cpp b/client/CHeroWindow.cpp index eae3ce77a..9ac4dd2ad 100644 --- a/client/CHeroWindow.cpp +++ b/client/CHeroWindow.cpp @@ -23,6 +23,7 @@ #include #include #include +#include /* * CHeroWindow.cpp, part of VCMI engine diff --git a/client/CSpellWindow.cpp b/client/CSpellWindow.cpp index 0675099a9..55716ff27 100644 --- a/client/CSpellWindow.cpp +++ b/client/CSpellWindow.cpp @@ -14,6 +14,8 @@ #include "../CCallback.h" #include #include +#include +#include /* * CSpellWindow.cpp, part of VCMI engine diff --git a/client/GUIClasses.cpp b/client/GUIClasses.cpp index 51748775a..de6697cc7 100644 --- a/client/GUIClasses.cpp +++ b/client/GUIClasses.cpp @@ -4148,16 +4148,17 @@ CExchangeWindow::CExchangeWindow(si32 hero1, si32 hero2) : bg(NULL) //secondary skill's clickable areas for(int g=0; gsecSkills.size(); ++g) { + int skill = heroInst[b]->secSkills[g].first, + level = heroInst[b]->secSkills[g].second; // <1, 3> secSkillAreas[b].push_back(new LRClickableAreaWTextComp()); secSkillAreas[b][g]->pos = genRect(32, 32, pos.x + 32 + g*36 + b*454 , pos.y + 88); secSkillAreas[b][g]->baseType = 1; - secSkillAreas[b][g]->type = heroInst[b]->secSkills[g].first; - secSkillAreas[b][g]->bonus = heroInst[b]->secSkills[g].second; - std::string hlp = CGI->generaltexth->skillInfoTexts[ heroInst[b]->secSkills[g].first ][heroInst[b]->secSkills[g].second-1]; - secSkillAreas[b][g]->text = hlp.substr(1, hlp.size()-2); + secSkillAreas[b][g]->type = skill; + secSkillAreas[b][g]->bonus = level; + secSkillAreas[b][g]->text = CGI->generaltexth->skillInfoTexts[skill][level-1]; - sprintf(bufor, CGI->generaltexth->heroscrn[21].c_str(), CGI->generaltexth->levels[heroInst[b]->secSkills[g].second-1].c_str(), CGI->generaltexth->skillName[heroInst[b]->secSkills[g].first].c_str()); + sprintf(bufor, CGI->generaltexth->heroscrn[21].c_str(), CGI->generaltexth->levels[level - 1].c_str(), CGI->generaltexth->skillName[skill].c_str()); secSkillAreas[b][g]->hoverText = std::string(bufor); } diff --git a/client/NetPacksClient.cpp b/client/NetPacksClient.cpp index b628e8622..034ea67ed 100644 --- a/client/NetPacksClient.cpp +++ b/client/NetPacksClient.cpp @@ -143,7 +143,8 @@ void RemoveObject::applyFirstCl( CClient *cl ) void RemoveObject::applyCl( CClient *cl ) { - GS(cl)->calculatePaths(cl->pathInfo->hero, *cl->pathInfo); + if(cl->pathInfo->hero) + GS(cl)->calculatePaths(cl->pathInfo->hero, *cl->pathInfo); } void TryMoveHero::applyFirstCl( CClient *cl ) diff --git a/client/VCMI_client.vcproj b/client/VCMI_client.vcproj index 206657f8b..ff723e875 100644 --- a/client/VCMI_client.vcproj +++ b/client/VCMI_client.vcproj @@ -39,7 +39,7 @@ /> CGameState::pickObject (CGObjectInstance *obj) for(unsigned int i=0;iobjh->cregens.size();i++) if(VLC->objh->cregens[i]==cid) return std::pair(17,i); - tlog3 << "Cannot find a dwelling for creature "<(17,0); } case 217: @@ -3067,6 +3067,7 @@ bool CPathsInfo::getPath( const int3 &dst, CGPath &out ) CPathsInfo::CPathsInfo( const int3 &Sizes ) :sizes(Sizes) { + hero = NULL; nodes = new CGPathNode**[sizes.x]; for(int i = 0; i < sizes.x; i++) { diff --git a/lib/VCMIDirs.h b/lib/VCMIDirs.h index 14d5d28bf..b9776b60e 100644 --- a/lib/VCMIDirs.h +++ b/lib/VCMIDirs.h @@ -8,9 +8,11 @@ * */ -#include +#ifndef _WIN32 //we need boost here only on non-win platforms + #include + using namespace boost::filesystem; +#endif -using namespace boost::filesystem; /* Where to find the various VCMI files. This is mostly usefull for linux. */ class VCMIDirs { diff --git a/lib/VCMI_lib.vcproj b/lib/VCMI_lib.vcproj index 280bb1da1..c001a71f4 100644 --- a/lib/VCMI_lib.vcproj +++ b/lib/VCMI_lib.vcproj @@ -39,7 +39,7 @@ /> + + diff --git a/server/VCMI_server.vcproj b/server/VCMI_server.vcproj index d92652999..98940245b 100644 --- a/server/VCMI_server.vcproj +++ b/server/VCMI_server.vcproj @@ -39,7 +39,7 @@ />