浏览代码

AiI will ignore winning conditions that require defeating his own objects. Fixes #2174

DjWarmonger 10 年之前
父节点
当前提交
f3c7774576
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      AI/VCAI/Goals.cpp

+ 6 - 0
AI/VCAI/Goals.cpp

@@ -221,6 +221,12 @@ TSubgoal Win::whatToDoToAchieve()
 			{
 				if (goal.object)
 				{
+					auto obj = cb->getObj (goal.object->id);
+					if (obj)
+						if (obj->getOwner() == ai->playerID) //we can't capture our own object
+							return sptr(Goals::Conquer());
+
+
 					return sptr (Goals::GetObj(goal.object->id.getNum()));
 				}
 				else