浏览代码

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.
Xilmi 1 年之前
父节点
当前提交
74f3aedcc9
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      AI/Nullkiller/Pathfinding/AINodeStorage.cpp

+ 4 - 0
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)