mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Fixed #906.
This commit is contained in:
parent
f7ae917645
commit
59681be0a4
@ -22,7 +22,7 @@ class CGTownInstance;
|
|||||||
using namespace boost::assign;
|
using namespace boost::assign;
|
||||||
using namespace vstd;
|
using namespace vstd;
|
||||||
|
|
||||||
FuzzyHelper fh;
|
FuzzyHelper *fh;
|
||||||
|
|
||||||
struct armyStructure
|
struct armyStructure
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#define I_AM_ELEMENTAR return CGoal(*this).setisElementar(true)
|
#define I_AM_ELEMENTAR return CGoal(*this).setisElementar(true)
|
||||||
CLogger &aiLogger = tlog6;
|
CLogger &aiLogger = tlog6;
|
||||||
|
|
||||||
extern FuzzyHelper fh;
|
extern FuzzyHelper *fh;
|
||||||
|
|
||||||
class CGVisitableOPW;
|
class CGVisitableOPW;
|
||||||
|
|
||||||
@ -287,7 +287,7 @@ ui64 evaluateDanger(crint3 tile, const CGHeroInstance *visitor)
|
|||||||
if (dangerousObject)
|
if (dangerousObject)
|
||||||
{
|
{
|
||||||
objectDanger = evaluateDanger(dangerousObject);
|
objectDanger = evaluateDanger(dangerousObject);
|
||||||
objectDanger *= fh.getTacticalAdvantage (visitor, dangerousObject);
|
objectDanger *= fh->getTacticalAdvantage (visitor, dangerousObject);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -337,7 +337,7 @@ ui64 evaluateDanger(const CGObjectInstance *obj)
|
|||||||
case Obj::SHIPWRECK: //shipwreck
|
case Obj::SHIPWRECK: //shipwreck
|
||||||
case Obj::DERELICT_SHIP: //derelict ship
|
case Obj::DERELICT_SHIP: //derelict ship
|
||||||
case Obj::PYRAMID:
|
case Obj::PYRAMID:
|
||||||
return fh.estimateBankDanger (VLC->objh->bankObjToIndex(obj));
|
return fh->estimateBankDanger (VLC->objh->bankObjToIndex(obj));
|
||||||
case Obj::WHIRLPOOL: //whirlpool
|
case Obj::WHIRLPOOL: //whirlpool
|
||||||
case Obj::MONOLITH1:
|
case Obj::MONOLITH1:
|
||||||
case Obj::MONOLITH2:
|
case Obj::MONOLITH2:
|
||||||
@ -745,6 +745,9 @@ void VCAI::init(CCallback * CB)
|
|||||||
myCb->waitTillRealize = true;
|
myCb->waitTillRealize = true;
|
||||||
myCb->unlockGsWhenWaiting = true;
|
myCb->unlockGsWhenWaiting = true;
|
||||||
|
|
||||||
|
if(!fh)
|
||||||
|
fh = new FuzzyHelper();
|
||||||
|
|
||||||
retreiveVisitableObjs(visitableObjs);
|
retreiveVisitableObjs(visitableObjs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user