Explorar el Código

Update AINodeStorage.cpp

Nodes along the path are now also considered for how dangerous it is.
Xilmi hace 1 año
padre
commit
d87f195bc7
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  1. 4 0
      AI/Nullkiller/Pathfinding/AINodeStorage.cpp

+ 4 - 0
AI/Nullkiller/Pathfinding/AINodeStorage.cpp

@@ -1419,6 +1419,10 @@ void AINodeStorage::calculateChainInfo(std::vector<AIPath> & paths, const int3 &
 		path.heroArmy = node.actor->creatureSet;
 		path.armyLoss = node.armyLoss;
 		path.targetObjectDanger = ai->dangerEvaluator->evaluateDanger(pos, path.targetHero, !node.actor->allowBattle);
+		for (auto pathNode : path.nodes)
+		{
+			path.targetObjectDanger = std::max(ai->dangerEvaluator->evaluateDanger(pathNode.coord, path.targetHero, !node.actor->allowBattle), path.targetObjectDanger);
+		}
 
 		if(path.targetObjectDanger > 0)
 		{