From 012212698e51fbf88373042a750852bcf9555199 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Sun, 20 Oct 2013 13:51:05 +0000 Subject: [PATCH] compile fixes, cmake files update --- AI/VCAI/AIUtility.cpp | 4 ++-- AI/VCAI/CMakeLists.txt | 2 ++ AI/VCAI/Goals.cpp | 5 ++++- AI/VCAI/VCAI.cpp | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/AI/VCAI/AIUtility.cpp b/AI/VCAI/AIUtility.cpp index 8f1c2728a..ccf932871 100644 --- a/AI/VCAI/AIUtility.cpp +++ b/AI/VCAI/AIUtility.cpp @@ -5,7 +5,7 @@ #include "../../lib/UnlockGuard.h" #include "../../lib/CObjectHandler.h" #include "../../lib/CConfigHandler.h" -#include "../../lib/CHeroHandler.h"" +#include "../../lib/CHeroHandler.h" /* * AIUtility.cpp, part of VCMI engine @@ -370,4 +370,4 @@ bool compareHeroStrength(HeroPtr h1, HeroPtr h2) bool compareArmyStrength(const CArmedInstance *a1, const CArmedInstance *a2) { return a1->getArmyStrength() < a2->getArmyStrength(); -} \ No newline at end of file +} diff --git a/AI/VCAI/CMakeLists.txt b/AI/VCAI/CMakeLists.txt index a5f90d4c1..95a3a7242 100644 --- a/AI/VCAI/CMakeLists.txt +++ b/AI/VCAI/CMakeLists.txt @@ -4,6 +4,8 @@ cmake_minimum_required(VERSION 2.6) include_directories(${Boost_INCLUDE_DIRS} ${CMAKE_HOME_DIRECTORY} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_HOME_DIRECTORY}/lib ${CMAKE_HOME_DIRECTORY}/AI/FuzzyLite) set(VCAI_SRCS + AIUtility.cpp + Goals.cpp main.cpp VCAI.cpp Fuzzy.cpp diff --git a/AI/VCAI/Goals.cpp b/AI/VCAI/Goals.cpp index acc1f8543..4ecb660bc 100644 --- a/AI/VCAI/Goals.cpp +++ b/AI/VCAI/Goals.cpp @@ -152,6 +152,7 @@ TSubgoal Win::whatToDoToAchieve() default: assert(0); } + return TSubgoal(Goals::INVALID); } TSubgoal FindObj::whatToDoToAchieve() @@ -202,6 +203,7 @@ TSubgoal VisitHero::whatToDoToAchieve() if (hero && ai->isAccessibleForHero(pos, hero, true) && isSafeToVisit(hero, pos)) //enemy heroes can get reinforcements return (*this).settile(pos).setisElementar(true); + return TSubgoal(Goals::INVALID); } TSubgoal GetArtOfType::whatToDoToAchieve() @@ -209,6 +211,7 @@ TSubgoal GetArtOfType::whatToDoToAchieve() TSubgoal alternativeWay = CGoal::lookForArtSmart(aid); //TODO: use if(alternativeWay.invalid()) return Goals::FindObj(Obj::ARTIFACT, aid); + return TSubgoal(Goals::INVALID); } TSubgoal ClearWayTo::whatToDoToAchieve() @@ -786,4 +789,4 @@ TSubgoal CGoal::lookForArtSmart(int aid) bool CGoal::invalid() const { return goalType == INVALID; -} \ No newline at end of file +} diff --git a/AI/VCAI/VCAI.cpp b/AI/VCAI/VCAI.cpp index 6aa2eab7c..d67186d58 100644 --- a/AI/VCAI/VCAI.cpp +++ b/AI/VCAI/VCAI.cpp @@ -1697,7 +1697,7 @@ void VCAI::striveToGoal(const Goals::CGoal &ultimateGoal) if (ultimateGoal.invalid()) return; - Goals::CGoal &abstractGoal = Goals::CGoal(); //reference must be initialized + Goals::CGoal abstractGoal; //can't create reference from temporary while(1) {