|
|
@@ -3308,13 +3308,19 @@ bool shouldVisit(HeroPtr h, const CGObjectInstance * obj)
|
|
|
case Obj::MAGIC_WELL:
|
|
|
return h->mana < h->manaLimit();
|
|
|
case Obj::PRISON:
|
|
|
- return ai->myCb->getHeroesInfo().size() < VLC->modh->settings.MAX_HEROES_ON_MAP_PER_PLAYER;// GameConstants::MAX_HEROES_PER_PLAYER;
|
|
|
-
|
|
|
+ return ai->myCb->getHeroesInfo().size() < VLC->modh->settings.MAX_HEROES_ON_MAP_PER_PLAYER;
|
|
|
+ case Obj::TAVERN:
|
|
|
+ {//TODO: make AI actually recruit heroes
|
|
|
+ //TODO: only on request
|
|
|
+ return (ai->myCb->getHeroesInfo().size() < VLC->modh->settings.MAX_HEROES_ON_MAP_PER_PLAYER) &&
|
|
|
+ (ai->myCb->getResourceAmount()[Res::GOLD] - GOLD_RESERVE >= GameConstants::HERO_GOLD_COST);
|
|
|
+ }
|
|
|
case Obj::BOAT:
|
|
|
return false;
|
|
|
//Boats are handled by pathfinder
|
|
|
case Obj::EYE_OF_MAGI:
|
|
|
return false; //this object is useless to visit, but could be visited indefinitely
|
|
|
+
|
|
|
}
|
|
|
|
|
|
if (obj->wasVisited(*h)) //it must pointer to hero instance, heroPtr calls function wasVisited(ui8 player);
|