瀏覽代碼

Some tweaks and performance improvements.

DjWarmonger 12 年之前
父節點
當前提交
045af73f0d
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      AI/VCAI/Goals.cpp

+ 5 - 5
AI/VCAI/Goals.cpp

@@ -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
 		});
 	}