浏览代码

Machine Factory and Refugee Camp can't be owned

Ivan Savenko 1 年之前
父节点
当前提交
44fdb71933
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      lib/mapObjects/CGDwelling.cpp

+ 8 - 1
lib/mapObjects/CGDwelling.cpp

@@ -536,7 +536,14 @@ void CGDwelling::serializeJsonOptions(JsonSerializeFormat & handler)
 
 const IOwnableObject * CGDwelling::asOwnable() const
 {
-	return this;
+	switch (ID.toEnum())
+	{
+		case Obj::WAR_MACHINE_FACTORY:
+		case Obj::REFUGEE_CAMP:
+			return nullptr; // can't be owned
+		default:
+			return this;
+	}
 }
 
 ResourceSet CGDwelling::dailyIncome() const