1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

AI: GATHER_TROOPS improvements and fixes

This commit is contained in:
Andrii Danylchenko
2018-11-11 23:02:05 +02:00
parent 614cde4a55
commit 60c5f584a8
4 changed files with 89 additions and 55 deletions

View File

@@ -144,6 +144,9 @@ Goals::TGoalVec PathfindingManager::findPath(
: clearWayTo(hero, firstTileToGet);
}
if(solution->invalid())
continue;
if(solution->evaluationContext.danger < danger)
solution->evaluationContext.danger = danger;
@@ -212,6 +215,7 @@ Goals::TSubgoal PathfindingManager::clearWayTo(HeroPtr hero, int3 firstTileToGet
//ret.push_back(ai->questToGoal());
//however, visiting obj for firts time will give us quest
//do not access quets guard if we can't complete the quest
logAi->trace("Can not visit this quest guard! Not ready!");
return sptr(Goals::Invalid());
}
}