diff --git a/source/g3d_viewer/main.cpp b/source/g3d_viewer/main.cpp index 6ae473022..11964fa78 100644 --- a/source/g3d_viewer/main.cpp +++ b/source/g3d_viewer/main.cpp @@ -273,7 +273,7 @@ MainWindow::MainWindow( std::pair > unitToLoad, menuMode->Check(miModeGrid, true); menuCustomColor->Check(miColorRed, true); - for(int i = 0; i < autoScreenShotParams.size(); ++i) { + for(unsigned int i = 0; i < autoScreenShotParams.size(); ++i) { if(autoScreenShotParams[i] == "transparent") { printf("Screenshot option [%s]\n",autoScreenShotParams[i].c_str()); menuFile->Check(miFileToggleScreenshotTransparent,true); @@ -692,7 +692,7 @@ void MainWindow::onMenumFileToggleScreenshotTransparent(wxCommandEvent &event) { void MainWindow::saveScreenshot() { try { int autoSaveScreenshotIndex = -1; - for(int i = 0; i < autoScreenShotParams.size(); ++i) { + for(unsigned int i = 0; i < autoScreenShotParams.size(); ++i) { if(_strnicmp(autoScreenShotParams[i].c_str(),"saveas-",7) == 0) { printf("Screenshot option [%s]\n",autoScreenShotParams[i].c_str()); autoSaveScreenshotIndex = i; @@ -826,11 +826,11 @@ void MainWindow::loadUnit(string path, string skillName) { const XmlNode *unitNode= xmlTree.getRootNode(); bool foundSkillName = false; - for(int skillIdx = 0; foundSkillName == false && skillIdx < this->unitPath.second.size(); ++skillIdx) { + for(unsigned int skillIdx = 0; foundSkillName == false && skillIdx < this->unitPath.second.size(); ++skillIdx) { string lookipForSkillName = this->unitPath.second[skillIdx]; const XmlNode *skillsNode= unitNode->getChild("skills"); - for(int i = 0; foundSkillName == false && i < skillsNode->getChildCount(); ++i) { + for(unsigned int i = 0; foundSkillName == false && i < skillsNode->getChildCount(); ++i) { const XmlNode *sn= skillsNode->getChild("skill", i); const XmlNode *typeNode= sn->getChild("type"); const XmlNode *nameNode= sn->getChild("name"); @@ -1735,7 +1735,7 @@ bool App::OnInit(){ if(delimitedList.size() >= 2) { unitToLoad.first = delimitedList[0]; - for(int i = 1; i < delimitedList.size(); ++i) { + for(unsigned int i = 1; i < delimitedList.size(); ++i) { unitToLoad.second.push_back(delimitedList[i]); } } diff --git a/source/glest_game/ai/route_planner.h b/source/glest_game/ai/route_planner.h index 36e450390..c8cd5155a 100644 --- a/source/glest_game/ai/route_planner.h +++ b/source/glest_game/ai/route_planner.h @@ -251,7 +251,7 @@ class TransitionHeuristic { public: TransitionHeuristic(const Vec2i &target) : dd(target) {} bool operator()(const Transition *t) const { - return dd(t->nwPos); + return (dd(t->nwPos) != 0); } }; diff --git a/source/glest_game/game/script_manager.cpp b/source/glest_game/game/script_manager.cpp index dfe198666..b2d0e9943 100644 --- a/source/glest_game/game/script_manager.cpp +++ b/source/glest_game/game/script_manager.cpp @@ -458,7 +458,7 @@ void ScriptManager::stopAllSound() { void ScriptManager::morphToUnit(int unitId,const string &morphName, int ignoreRequirements) { SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d] unit [%d] morphName [%s] forceUpgradesIfRequired = %d\n",__FILE__,__FUNCTION__,__LINE__,unitId,morphName.c_str(),ignoreRequirements); ScriptManager_STREFLOP_Wrapper streflopWrapper; - world->morphToUnit(unitId,morphName,ignoreRequirements); + world->morphToUnit(unitId,morphName,(ignoreRequirements == 1)); } void ScriptManager::giveResource(const string &resourceName, int factionIndex, int amount){ @@ -494,7 +494,7 @@ void ScriptManager::giveUpgradeCommand(int unitId, const string &producedName){ void ScriptManager::giveAttackStoppedCommand(int unitId, const string &itemName,int ignoreRequirements) { SystemFlags::OutputDebug(SystemFlags::debugLUA,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); ScriptManager_STREFLOP_Wrapper streflopWrapper; - world->giveAttackStoppedCommand(unitId, itemName, ignoreRequirements); + world->giveAttackStoppedCommand(unitId, itemName, (ignoreRequirements == 1)); } void ScriptManager::disableAi(int factionIndex){