diff --git a/AI/Nullkiller/Pathfinding/ObjectGraph.cpp b/AI/Nullkiller/Pathfinding/ObjectGraph.cpp index 17a58c697..a30c41876 100644 --- a/AI/Nullkiller/Pathfinding/ObjectGraph.cpp +++ b/AI/Nullkiller/Pathfinding/ObjectGraph.cpp @@ -504,11 +504,11 @@ void ObjectGraph::connectHeroes(const Nullkiller * ai) auto heroPos = path.targetHero->visitablePos(); nodes[pos].connections[heroPos].update( - path.movementCost(), + std::max(0.0f, path.movementCost()), path.getPathDanger()); nodes[heroPos].connections[pos].update( - path.movementCost(), + std::max(0.0f, path.movementCost()), path.getPathDanger()); } }