1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-10-31 00:07:39 +02:00

Fixed new issue with hero trying to visit himself.

This commit is contained in:
DjWarmonger
2013-11-24 08:56:02 +00:00
parent cedb3ea82a
commit 74a1d09871
2 changed files with 3 additions and 1 deletions

View File

@@ -752,7 +752,7 @@ TSubgoal GatherArmy::whatToDoToAchieve()
return sptr (Goals::VisitHero(h->id.getNum()).setisAbstract(true).sethero(hero));
//go to the other hero if we are faster
else
return sptr (Goals::VisitHero(h->id.getNum()).setisAbstract(true).sethero(h));
return sptr (Goals::VisitHero(hero->id.getNum()).setisAbstract(true).sethero(h));
//let the other hero come to us
}
}

View File

@@ -1220,8 +1220,10 @@ void VCAI::setGoal(HeroPtr h, Goals::TSubgoal goal)
if (goal->invalid())
erase_if_present(lockedHeroes, h);
else
{
lockedHeroes[h] = goal;
goal->setisElementar(false); //always evaluate goals before realizing
}
}
void VCAI::completeGoal (Goals::TSubgoal goal)