diff --git a/AI/VCAI/Goals.cpp b/AI/VCAI/Goals.cpp index 72bb00135..e86424eda 100644 --- a/AI/VCAI/Goals.cpp +++ b/AI/VCAI/Goals.cpp @@ -518,10 +518,10 @@ TGoalVec ClearWayTo::getAllPossibleSubgoals() { //TODO: we should be able to return apriopriate quest here (VCAI::striveToQuest) logAi->debugStream() << "Quest guard blocks the way to " + tile(); + continue; //do not access quets guard if we can't complete the quest } } } - if (isSafeToVisit(h, tileToHit)) //this makes sense only if tile is guarded, but there i no quest object { ret.push_back (sptr (Goals::VisitTile(tileToHit).sethero(h))); diff --git a/AI/VCAI/VCAI.cpp b/AI/VCAI/VCAI.cpp index cb5ede522..524576bcb 100644 --- a/AI/VCAI/VCAI.cpp +++ b/AI/VCAI/VCAI.cpp @@ -2455,11 +2455,13 @@ void VCAI::buildArmyIn(const CGTownInstance * t) int3 VCAI::explorationBestNeighbour(int3 hpos, int radius, HeroPtr h) { + int3 ourPos = h->convertPosition(h->pos, false); std::map dstToRevealedTiles; for(crint3 dir : dirs) if(cb->isInTheMap(hpos+dir)) - if (isSafeToVisit(h, hpos + dir) && isAccessibleForHero (hpos + dir, h)) - dstToRevealedTiles[hpos + dir] = howManyTilesWillBeDiscovered(radius, hpos, dir); + if (ourPos != dir) //don't stand in place + if (isSafeToVisit(h, hpos + dir) && isAccessibleForHero (hpos + dir, h)) + dstToRevealedTiles[hpos + dir] = howManyTilesWillBeDiscovered(radius, hpos, dir); if (dstToRevealedTiles.empty()) //yes, it DID happen! throw cannotFulfillGoalException("No neighbour will bring new discoveries!");