From 74f3aedcc9286e0a21f5c08d17f61bfdc831ce60 Mon Sep 17 00:00:00 2001 From: Xilmi Date: Mon, 30 Sep 2024 19:32:27 +0200 Subject: [PATCH] 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. --- AI/Nullkiller/Pathfinding/AINodeStorage.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/AI/Nullkiller/Pathfinding/AINodeStorage.cpp b/AI/Nullkiller/Pathfinding/AINodeStorage.cpp index fe8912c7a..c22ef912f 100644 --- a/AI/Nullkiller/Pathfinding/AINodeStorage.cpp +++ b/AI/Nullkiller/Pathfinding/AINodeStorage.cpp @@ -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)