1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Fixed heroes getting stuck because their assigned tile was captured by another hero.

This commit is contained in:
DjWarmonger 2013-12-21 07:37:23 +00:00
parent 045af73f0d
commit 5ec3685041

View File

@ -493,7 +493,13 @@ TGoalVec VisitTile::getAllPossibleSubgoals()
ret.push_back (sptr(Goals::Explore())); //what sense does it make?
else
{
for (auto h : cb->getHeroesInfo())
std::vector<const CGHeroInstance *> heroes;
if (hero)
heroes.push_back(hero.h); //use assigned hero if any
else
heroes = cb->getHeroesInfo(); //use most convenient hero
for (auto h : heroes)
{
if (ai->isAccessibleForHero(tile, h))
ret.push_back (sptr(Goals::VisitTile(tile).sethero(h)));