浏览代码

Merge branch 'develop' of https://github.com/vcmi/vcmi into RMG

DjWarmonger 11 年之前
父节点
当前提交
ccb475b699
共有 2 个文件被更改,包括 12 次插入9 次删除
  1. 0 0
      README.md
  2. 12 9
      lib/CTownHandler.cpp

+ 0 - 0
README → README.md


+ 12 - 9
lib/CTownHandler.cpp

@@ -688,7 +688,19 @@ void CTownHandler::loadObject(std::string scope, std::string name, const JsonNod
 			JsonNode config = data["town"]["mapObject"];
 			config["faction"].String() = object->identifier;
 			config["faction"].meta = scope;
+			if (config.meta.empty())// MODS COMPATIBILITY FOR 0.96
+				config.meta = scope;
 			VLC->objtypeh->loadSubObject(object->identifier, config, index, object->index);
+
+			// MODS COMPATIBILITY FOR 0.96
+			auto & advMap = data["town"]["adventureMap"];
+			if (!advMap.isNull())
+			{
+				logGlobal->warnStream() << "Outdated town mod. Will try to generate valid templates out of fort";
+				JsonNode config;
+				config["animation"] = advMap["castle"];
+				VLC->objtypeh->getHandlerFor(index, object->index)->addTemplate(config);
+			}
 		});
 	}
 
@@ -717,15 +729,6 @@ void CTownHandler::loadObject(std::string scope, std::string name, const JsonNod
 			config["faction"].String() = object->identifier;
 			config["faction"].meta = scope;
 			VLC->objtypeh->loadSubObject(object->identifier, config, index, object->index);
-
-			// MODS COMPATIBILITY FOR 0.96
-			auto & advMap = data["town"]["adventureMap"];
-			if (!advMap["fort"].isNull())
-			{
-				JsonNode config;
-				config["appearance"] = advMap["fort"];
-				VLC->objtypeh->getHandlerFor(index, object->index)->addTemplate(config);
-			}
 		});
 	}