From 44fdb719336a59c6b440abe19d3ebb356735a4d9 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Wed, 4 Sep 2024 19:46:58 +0000 Subject: [PATCH] Machine Factory and Refugee Camp can't be owned --- lib/mapObjects/CGDwelling.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/mapObjects/CGDwelling.cpp b/lib/mapObjects/CGDwelling.cpp index 4c8e473fb..983194342 100644 --- a/lib/mapObjects/CGDwelling.cpp +++ b/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