1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Some tweaks and performance improvements.

This commit is contained in:
DjWarmonger 2013-12-20 21:10:43 +00:00
parent bf3fe0e274
commit 045af73f0d

View File

@ -383,15 +383,15 @@ TSubgoal Explore::whatToDoToAchieve()
TGoalVec Explore::getAllPossibleSubgoals()
{
TGoalVec ret;
std::vector<const CGHeroInstance *> heroes;
std::vector<HeroPtr> heroes;
if (hero)
heroes.push_back(hero.h);
heroes.push_back(hero);
else
{
heroes = cb->getHeroesInfo();
erase_if(heroes, [](const CGHeroInstance *h)
heroes = ai->getUnblockedHeroes();
erase_if (heroes, [](const HeroPtr h)
{
return !h->movement; //only hero with movement are of interest for us
return !h->movement; //saves time, immobile heroes are useless anyway
});
}