1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

#3842 - fix negative link cost because of bonuses

This commit is contained in:
Andrii Danylchenko 2024-04-28 09:11:00 +03:00
parent 90fa1718a5
commit f1d7151a93

View File

@ -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());
}
}