1
0
mirror of https://github.com/vcmi/vcmi.git synced 2026-05-22 09:55:17 +02:00

Merge branch 'vcmi/beta' into 'vcmi/develop'

This commit is contained in:
Ivan Savenko
2024-06-11 19:22:23 +00:00
229 changed files with 9568 additions and 11605 deletions
+10 -3
View File
@@ -26,9 +26,9 @@ bool ExploreNeighbourTile::operator==(const ExploreNeighbourTile & other) const
void ExploreNeighbourTile::accept(AIGateway * ai)
{
ExplorationHelper h(hero, ai->nullkiller.get());
ExplorationHelper h(hero, ai->nullkiller.get(), true);
for(int i = 0; i < tilesToExplore && hero->movementPointsRemaining() > 0; i++)
for(int i = 0; i < tilesToExplore && ai->myCb->getObj(hero->id, false) && hero->movementPointsRemaining() > 0; i++)
{
int3 pos = hero->visitablePos();
float value = 0;
@@ -54,7 +54,14 @@ void ExploreNeighbourTile::accept(AIGateway * ai)
}
});
if(!target.valid() || !ai->moveHeroToTile(target, hero))
if(!target.valid())
{
return;
}
auto danger = ai->nullkiller->pathfinder->getStorage()->evaluateDanger(target, hero, true);
if(danger > 0 || !ai->moveHeroToTile(target, hero))
{
return;
}