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:
parent
c77fa499e7
commit
012212698e
@ -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();
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user