Przeglądaj źródła

Machine Factory and Refugee Camp can't be owned

Ivan Savenko 1 rok temu
rodzic
commit
44fdb71933
1 zmienionych plików z 8 dodań i 1 usunięć
  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
 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
 ResourceSet CGDwelling::dailyIncome() const