瀏覽代碼

VCAI: little improvement for 2a59cb619137cb443adce6aba009ecf37a6a57da

ArseniyShestakov 10 年之前
父節點
當前提交
866a0a1fc0
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      AI/VCAI/VCAI.cpp

+ 2 - 1
AI/VCAI/VCAI.cpp

@@ -3372,7 +3372,8 @@ int3 SectorMap::findFirstVisitableTile (HeroPtr h, crint3 dst)
 	while(curtile != h->visitablePos())
 	{
 		auto topObj = cb->getTopObj(curtile);
-		if (topObj && topObj->ID == Obj::HERO && h->tempOwner == topObj->tempOwner && topObj != h.h)
+		if(topObj && topObj->ID == Obj::HERO && topObj != h.h &&
+			cb->getPlayerRelations(h->tempOwner, topObj->tempOwner) != PlayerRelations::ENEMIES)
 		{
 			logAi->warnStream() << ("Another allied hero stands in our way");
 			return ret;