Explorar o código

Update RecruitHeroBehavior.cpp

Fixed crash caused by mistakenly assuming that "pos" is the position of a hero on the map and not its bottom-right-corner that can be outside of the map.
Xilmi hai 1 ano
pai
achega
8c3f6fc1e2
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      AI/Nullkiller/Behaviors/RecruitHeroBehavior.cpp

+ 1 - 1
AI/Nullkiller/Behaviors/RecruitHeroBehavior.cpp

@@ -70,7 +70,7 @@ Goals::TGoalVec RecruitHeroBehavior::decompose(const Nullkiller * ai) const
 		float visitability = 0;
 		for (auto checkHero : ourHeroes)
 		{
-			if (ai->dangerHitMap->getClosestTown(checkHero.first.get()->pos) == town)
+			if (ai->dangerHitMap->getClosestTown(checkHero.first.get()->visitablePos()) == town)
 				visitability++;
 		}
 		if(ai->heroManager->canRecruitHero(town))