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:
commit
8fd2849b0b
@ -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());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user