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

Merge pull request #3847 from vcmi/fix-3842

#3842 - fix negative link cost because of bonuses
This commit is contained in:
Ivan Savenko 2024-04-28 19:35:27 +03:00 committed by GitHub
commit 8fd2849b0b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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