浏览代码

Add missing check for file presence

Ivan Savenko 2 年之前
父节点
当前提交
805721f8d7
共有 2 个文件被更改,包括 4 次插入0 次删除
  1. 1 0
      config/schemas/battlefield.json
  2. 3 0
      lib/CModHandler.cpp

+ 1 - 0
config/schemas/battlefield.json

@@ -18,6 +18,7 @@
 		},
 		},
 		"graphics": {
 		"graphics": {
 			"type":"string",
 			"type":"string",
+			"format" : "imageFile",
 			"description": "BMP battleground resource"
 			"description": "BMP battleground resource"
 		},
 		},
 		"isSpecial": {
 		"isSpecial": {

+ 3 - 0
lib/CModHandler.cpp

@@ -422,6 +422,9 @@ bool ContentTypeHandler::loadMod(const std::string & modName, bool validate)
 		const std::string & name = entry.first;
 		const std::string & name = entry.first;
 		JsonNode & data = entry.second;
 		JsonNode & data = entry.second;
 
 
+		if (data.meta != modName)
+			logMod->warn("Mod %s is attempting to inject object %s into mod %s! This may not be supported in future versions!", data.meta, name, modName);
+
 		if (vstd::contains(data.Struct(), "index") && !data["index"].isNull())
 		if (vstd::contains(data.Struct(), "index") && !data["index"].isNull())
 		{
 		{
 			if (modName != "core")
 			if (modName != "core")