mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-03 14:52:11 +02:00
Update AINodeStorage.cpp
Nodes along the path are now also considered for how dangerous it is.
This commit is contained in:
parent
71504a3140
commit
d87f195bc7
@ -1419,6 +1419,10 @@ void AINodeStorage::calculateChainInfo(std::vector<AIPath> & paths, const int3 &
|
||||
path.heroArmy = node.actor->creatureSet;
|
||||
path.armyLoss = node.armyLoss;
|
||||
path.targetObjectDanger = ai->dangerEvaluator->evaluateDanger(pos, path.targetHero, !node.actor->allowBattle);
|
||||
for (auto pathNode : path.nodes)
|
||||
{
|
||||
path.targetObjectDanger = std::max(ai->dangerEvaluator->evaluateDanger(pathNode.coord, path.targetHero, !node.actor->allowBattle), path.targetObjectDanger);
|
||||
}
|
||||
|
||||
if(path.targetObjectDanger > 0)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user