mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
VCAI: do not buy heroes with single creatures for GatherArmy
This commit is contained in:
@@ -1112,8 +1112,21 @@ TGoalVec GatherArmy::getAllPossibleSubgoals()
|
|||||||
ret.push_back (sptr (Goals::VisitTile(pos).sethero(h)));
|
ret.push_back (sptr (Goals::VisitTile(pos).sethero(h)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ai->canRecruitAnyHero()) //this is not stupid in early phase of game
|
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())
|
if (ret.empty())
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user