1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-26 22:57:00 +02:00

compile fixes, cmake files update

This commit is contained in:
Ivan Savenko 2013-10-20 13:51:05 +00:00
parent c77fa499e7
commit 012212698e
4 changed files with 9 additions and 4 deletions

View File

@ -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();
}
}

View File

@ -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

View File

@ -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;
}
}

View File

@ -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)
{