Просмотр исходного кода

Merge pull request #5209 from IvanSavenko/ai_graph_fix

Correctly initialize graph cost in turns instead of default 255 turns
Ivan Savenko 11 месяцев назад
Родитель
Сommit
718f216fdd
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      AI/Nullkiller/Pathfinding/GraphPaths.cpp

+ 1 - 0
AI/Nullkiller/Pathfinding/GraphPaths.cpp

@@ -367,6 +367,7 @@ void GraphPaths::quickAddChainInfoWithBlocker(std::vector<AIPath> & paths, int3
 			// final node
 			// final node
 			n.coord = tile;
 			n.coord = tile;
 			n.cost = targetNode.cost;
 			n.cost = targetNode.cost;
+			n.turns = static_cast<ui8>(targetNode.cost);
 			n.danger = danger;
 			n.danger = danger;
 			n.parentIndex = path.nodes.size();
 			n.parentIndex = path.nodes.size();
 			path.nodes.push_back(n);
 			path.nodes.push_back(n);