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

TP onto friend attempt

Fixed an issue that caused the AI to think it can townportal onto heroes of other factions, for example their allies.
This commit is contained in:
Xilmi 2024-09-30 19:32:27 +02:00
parent d59a1fe9e9
commit 74f3aedcc9

View File

@ -1197,6 +1197,10 @@ void AINodeStorage::calculateTownPortal(
continue;
}
if (targetTown->visitingHero
&& targetTown->visitingHero.get()->getFaction() != actor->hero->getFaction())
continue;
auto nodeOptional = townPortalFinder.createTownPortalNode(targetTown);
if(nodeOptional)