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

Another reason not to try to town-portal

Even if the hero blocking a town is from the own faction, the town must not become a target if the city has stashed armies because in that case the hero ontop of it won't be able to go into garrison for the TP.
This commit is contained in:
Xilmi 2024-09-30 19:41:39 +02:00
parent 74f3aedcc9
commit 73e7d3f5bb

View File

@ -1198,7 +1198,8 @@ void AINodeStorage::calculateTownPortal(
}
if (targetTown->visitingHero
&& targetTown->visitingHero.get()->getFaction() != actor->hero->getFaction())
&& (targetTown->visitingHero.get()->getFaction() != actor->hero->getFaction()
|| targetTown->getUpperArmy()->stacksCount()))
continue;
auto nodeOptional = townPortalFinder.createTownPortalNode(targetTown);