1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

VCAI: do not buy heroes with single creatures for GatherArmy

This commit is contained in:
DjWarmonger 2016-11-26 18:03:09 +01:00
parent 3c3b973597
commit 169334f877

View File

@ -1112,8 +1112,21 @@ TGoalVec GatherArmy::getAllPossibleSubgoals()
ret.push_back (sptr (Goals::VisitTile(pos).sethero(h)));
}
}
if (ai->canRecruitAnyHero()) //this is not stupid in early phase of game
ret.push_back (sptr(Goals::RecruitHero()));
{
if (auto t = ai->findTownWithTavern())
{
for (auto h : cb->getAvailableHeroes(t)) //we assume that all towns have same set of heroes
{
if (h && h->getTotalStrength() > 500) //do not buy heroes with single creatures for GatherArmy
{
ret.push_back(sptr(Goals::RecruitHero()));
break;
}
}
}
}
if (ret.empty())
{