Переглянути джерело

Ignore all ExceuteHeroChain-tasks with 0 movement-cost

These can happen when an enemy spawns ontop of an AI-hero. If the action would win, it wouldn't be executed anyways. So now AI does the next best thing instead, which likely what it wanted to do anyways.
Xilmi 10 місяців тому
батько
коміт
650db73300
1 змінених файлів з 3 додано та 0 видалено
  1. 3 0
      AI/Nullkiller/Engine/PriorityEvaluator.cpp

+ 3 - 0
AI/Nullkiller/Engine/PriorityEvaluator.cpp

@@ -1006,6 +1006,9 @@ public:
 		Goals::ExecuteHeroChain & chain = dynamic_cast<Goals::ExecuteHeroChain &>(*task);
 		const AIPath & path = chain.getPath();
 
+		if (path.movementCost() == 0)
+			return;
+
 		vstd::amax(evaluationContext.danger, path.getTotalDanger());
 		evaluationContext.movementCost += path.movementCost();
 		evaluationContext.closestWayRatio = chain.closestWayRatio;