소스 검색

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.
Xilmi 1 년 전
부모
커밋
73e7d3f5bb
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      AI/Nullkiller/Pathfinding/AINodeStorage.cpp

+ 2 - 1
AI/Nullkiller/Pathfinding/AINodeStorage.cpp

@@ -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);