1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Merge pull request #1918 from IvanSavenko/fix_map_loading

Fix vcmi map loading
This commit is contained in:
Ivan Savenko
2023-04-09 20:08:23 +03:00
committed by GitHub
6 changed files with 72 additions and 33 deletions

View File

@@ -18,6 +18,7 @@
"value" : 100, "value" : 100,
"rarity" : 100 "rarity" : 100
}, },
"compatibilityIdentifiers" : [ "object" ],
"blockedVisitable" : true, "blockedVisitable" : true,
"onVisitedMessage" : 22, "onVisitedMessage" : 22,
@@ -49,6 +50,7 @@
"value" : 100, "value" : 100,
"rarity" : 100 "rarity" : 100
}, },
"compatibilityIdentifiers" : [ "object" ],
"onVisitedMessage" : 30, "onVisitedMessage" : 30,
"visitMode" : "bonus", "visitMode" : "bonus",
@@ -81,6 +83,7 @@
"value" : 100, "value" : 100,
"rarity" : 100 "rarity" : 100
}, },
"compatibilityIdentifiers" : [ "object" ],
"onVisitedMessage" : 50, "onVisitedMessage" : 50,
"visitMode" : "bonus", "visitMode" : "bonus",
@@ -112,6 +115,7 @@
"value" : 100, "value" : 100,
"rarity" : 100 "rarity" : 100
}, },
"compatibilityIdentifiers" : [ "object" ],
"onVisitedMessage" : 56, "onVisitedMessage" : 56,
"visitMode" : "bonus", "visitMode" : "bonus",
@@ -164,6 +168,7 @@
"value" : 100, "value" : 100,
"rarity" : 50 "rarity" : 50
}, },
"compatibilityIdentifiers" : [ "object" ],
"onVisitedMessage" : 58, "onVisitedMessage" : 58,
"visitMode" : "bonus", "visitMode" : "bonus",
@@ -195,6 +200,7 @@
"value" : 100, "value" : 100,
"rarity" : 100 "rarity" : 100
}, },
"compatibilityIdentifiers" : [ "object" ],
"onVisitedMessage" : 63, "onVisitedMessage" : 63,
"visitMode" : "bonus", "visitMode" : "bonus",
@@ -250,6 +256,7 @@
"value" : 100, "value" : 100,
"rarity" : 20 "rarity" : 20
}, },
"compatibilityIdentifiers" : [ "object" ],
"onVisitedMessage" : 82, "onVisitedMessage" : 82,
"visitMode" : "bonus", "visitMode" : "bonus",
@@ -280,6 +287,7 @@
"value" : 100, "value" : 100,
"rarity" : 50 "rarity" : 50
}, },
"compatibilityIdentifiers" : [ "object" ],
"onVisitedMessage" : 95, "onVisitedMessage" : 95,
"visitMode" : "bonus", "visitMode" : "bonus",
@@ -312,10 +320,10 @@
"value" : 200, "value" : 200,
"rarity" : 40 "rarity" : 40
}, },
"compatibilityIdentifiers" : [ "object" ],
"visitMode" : "bonus", "visitMode" : "bonus",
"selectMode" : "selectFirst", "selectMode" : "selectFirst",
"onVisited" : [ "onVisited" : [
{ {
"message" : 139, "message" : 139,
@@ -370,6 +378,7 @@
"value" : 100, "value" : 100,
"rarity" : 100 "rarity" : 100
}, },
"compatibilityIdentifiers" : [ "object" ],
"onVisitedMessage" : 141, "onVisitedMessage" : 141,
"visitMode" : "bonus", "visitMode" : "bonus",
@@ -406,6 +415,7 @@
"value" : 100, "value" : 100,
"rarity" : 100 "rarity" : 100
}, },
"compatibilityIdentifiers" : [ "object" ],
"onVisitedMessage" : 111, "onVisitedMessage" : 111,
"visitMode" : "bonus", "visitMode" : "bonus",
@@ -440,6 +450,7 @@
"value" : 500, "value" : 500,
"rarity" : 50 "rarity" : 50
}, },
"compatibilityIdentifiers" : [ "object" ],
"onVisitedMessage" : 167, "onVisitedMessage" : 167,
"visitMode" : "bonus", "visitMode" : "bonus",

View File

@@ -18,6 +18,7 @@
"value" : 3000, "value" : 3000,
"rarity" : 50 "rarity" : 50
}, },
"compatibilityIdentifiers" : [ "object" ],
"onSelectMessage" : 0, "onSelectMessage" : 0,
"onVisitedMessage" : 1, "onVisitedMessage" : 1,
@@ -51,6 +52,7 @@
"value" : 1500, "value" : 1500,
"rarity" : 100 "rarity" : 100
}, },
"compatibilityIdentifiers" : [ "object" ],
"onVisitedMessage" : 40, "onVisitedMessage" : 40,
"visitMode" : "hero", "visitMode" : "hero",
@@ -81,6 +83,7 @@
"value" : 1500, "value" : 1500,
"rarity" : 100 "rarity" : 100
}, },
"compatibilityIdentifiers" : [ "object" ],
"onVisitedMessage" : 60, "onVisitedMessage" : 60,
"visitMode" : "hero", "visitMode" : "hero",
@@ -110,6 +113,7 @@
"value" : 12000, "value" : 12000,
"rarity" : 20 "rarity" : 20
}, },
"compatibilityIdentifiers" : [ "object" ],
"onVisitedMessage" : 67, "onVisitedMessage" : 67,
"onEmptyMessage" : 68, "onEmptyMessage" : 68,
@@ -154,6 +158,7 @@
"value" : 1500, "value" : 1500,
"rarity" : 100 "rarity" : 100
}, },
"compatibilityIdentifiers" : [ "object" ],
"onVisitedMessage" : 81, "onVisitedMessage" : 81,
"visitMode" : "hero", "visitMode" : "hero",
@@ -184,6 +189,7 @@
"value" : 1500, "value" : 1500,
"rarity" : 100 "rarity" : 100
}, },
"compatibilityIdentifiers" : [ "object" ],
"onVisitedMessage" : 101, "onVisitedMessage" : 101,
"visitMode" : "hero", "visitMode" : "hero",
@@ -214,6 +220,7 @@
"value" : 2500, "value" : 2500,
"rarity" : 50 "rarity" : 50
}, },
"compatibilityIdentifiers" : [ "object" ],
"onEmpty" : [ "onEmpty" : [
{ {
@@ -270,6 +277,7 @@
"value" : 1000, "value" : 1000,
"rarity" : 50 "rarity" : 50
}, },
"compatibilityIdentifiers" : [ "object" ],
"onSelectMessage" : 71, "onSelectMessage" : 71,
"onVisitedMessage" : 72, "onVisitedMessage" : 72,
@@ -309,6 +317,7 @@
"value" : 1000, "value" : 1000,
"rarity" : 50 "rarity" : 50
}, },
"compatibilityIdentifiers" : [ "object" ],
"onSelectMessage" : 158, "onSelectMessage" : 158,
"onVisitedMessage" : 159, "onVisitedMessage" : 159,
@@ -348,6 +357,7 @@
"value" : 1500, "value" : 1500,
"rarity" : 200 "rarity" : 200
}, },
"compatibilityIdentifiers" : [ "object" ],
"onVisitedMessage" : 144, "onVisitedMessage" : 144,
"visitMode" : "hero", "visitMode" : "hero",

View File

@@ -17,6 +17,7 @@
"value" : 250, "value" : 250,
"rarity" : 100 "rarity" : 100
}, },
"compatibilityIdentifiers" : [ "object" ],
"onEmptyMessage" : 79, "onEmptyMessage" : 79,
"onVisitedMessage" : 78, "onVisitedMessage" : 78,
@@ -54,6 +55,7 @@
// "value" : 500, // "value" : 500,
// "rarity" : 50 // "rarity" : 50
//}, //},
"compatibilityIdentifiers" : [ "object" ],
"onEmptyMessage" : 76, "onEmptyMessage" : 76,
"onVisitedMessage" : 75, "onVisitedMessage" : 75,
@@ -92,6 +94,7 @@
"value" : 500, "value" : 500,
"rarity" : 50 "rarity" : 50
}, },
"compatibilityIdentifiers" : [ "object" ],
"onVisitedMessage" : 93, "onVisitedMessage" : 93,
"resetParameters" : { "resetParameters" : {
@@ -133,6 +136,7 @@
"value" : 1500, "value" : 1500,
"rarity" : 80 "rarity" : 80
}, },
"compatibilityIdentifiers" : [ "object" ],
"onVisitedMessage" : 169, "onVisitedMessage" : 169,
"resetParameters" : { "resetParameters" : {
@@ -174,6 +178,7 @@
"value" : 750, "value" : 750,
"rarity" : 50 "rarity" : 50
}, },
"compatibilityIdentifiers" : [ "object" ],
"onVisitedMessage" : 165, "onVisitedMessage" : 165,
"resetParameters" : { "resetParameters" : {

View File

@@ -17,6 +17,7 @@
"value" : 500, "value" : 500,
"rarity" : 100 "rarity" : 100
}, },
"compatibilityIdentifiers" : [ "object" ],
"onVisitedMessage" : 65, "onVisitedMessage" : 65,
"visitMode" : "once", "visitMode" : "once",
@@ -52,6 +53,7 @@
"value" : 500, "value" : 500,
"rarity" : 100 "rarity" : 100
}, },
"compatibilityIdentifiers" : [ "object" ],
"onVisitedMessage" : 38, "onVisitedMessage" : 38,
"blockedVisitable" : true, "blockedVisitable" : true,
@@ -92,6 +94,7 @@
"value" : 500, "value" : 500,
"rarity" : 50 "rarity" : 50
}, },
"compatibilityIdentifiers" : [ "object" ],
"onVisitedMessage" : 156, "onVisitedMessage" : 156,
"visitMode" : "once", "visitMode" : "once",
@@ -142,6 +145,7 @@
"value" : 6000, "value" : 6000,
"rarity" : 20 "rarity" : 20
}, },
"compatibilityIdentifiers" : [ "object" ],
"onSelectMessage" : 161, "onSelectMessage" : 161,
"visitMode" : "once", "visitMode" : "once",

View File

@@ -19,6 +19,7 @@
"value" : 2000, "value" : 2000,
"rarity" : 500 "rarity" : 500
}, },
"compatibilityIdentifiers" : [ "object" ],
"blockedVisitable" : true, "blockedVisitable" : true,
"visitMode" : "unlimited", "visitMode" : "unlimited",
@@ -60,6 +61,7 @@
"value" : 2000, "value" : 2000,
"rarity" : 100 "rarity" : 100
}, },
"compatibilityIdentifiers" : [ "object" ],
"blockedVisitable" : true, "blockedVisitable" : true,
"visitMode" : "unlimited", "visitMode" : "unlimited",
@@ -117,6 +119,7 @@
"value" : 1500, "value" : 1500,
"rarity" : 500 "rarity" : 500
}, },
"compatibilityIdentifiers" : [ "object" ],
"blockedVisitable" : true, "blockedVisitable" : true,
"visitMode" : "unlimited", "visitMode" : "unlimited",
@@ -167,6 +170,7 @@
"value" : 1500, "value" : 1500,
"rarity" : 50 "rarity" : 50
}, },
"compatibilityIdentifiers" : [ "object" ],
"blockedVisitable" : true, "blockedVisitable" : true,
"visitMode" : "unlimited", "visitMode" : "unlimited",
@@ -217,6 +221,7 @@
"value" : 1500, "value" : 1500,
"rarity" : 1000 "rarity" : 1000
}, },
"compatibilityIdentifiers" : [ "object" ],
"blockedVisitable" : true, "blockedVisitable" : true,
"onSelectMessage" : 146, "onSelectMessage" : 146,

View File

@@ -165,6 +165,8 @@ void CObjectClassesHandler::loadSubObject(const std::string & scope, const std::
obj->objects.push_back(object); obj->objects.push_back(object);
registerObject(scope, obj->getJsonKey(), object->getSubTypeName(), object->subtype); registerObject(scope, obj->getJsonKey(), object->getSubTypeName(), object->subtype);
for (auto const & compatID : entry["compatibilityIdentifiers"].Vector())
registerObject(scope, obj->getJsonKey(), compatID.String(), object->subtype);
} }
void CObjectClassesHandler::loadSubObject(const std::string & scope, const std::string & identifier, const JsonNode & entry, ObjectClass * obj, size_t index) void CObjectClassesHandler::loadSubObject(const std::string & scope, const std::string & identifier, const JsonNode & entry, ObjectClass * obj, size_t index)
@@ -176,6 +178,8 @@ void CObjectClassesHandler::loadSubObject(const std::string & scope, const std::
obj->objects[index] = object; obj->objects[index] = object;
registerObject(scope, obj->getJsonKey(), object->getSubTypeName(), object->subtype); registerObject(scope, obj->getJsonKey(), object->getSubTypeName(), object->subtype);
for (auto const & compatID : entry["compatibilityIdentifiers"].Vector())
registerObject(scope, obj->getJsonKey(), compatID.String(), object->subtype);
} }
TObjectTypeHandler CObjectClassesHandler::loadSubObjectFromJson(const std::string & scope, const std::string & identifier, const JsonNode & entry, ObjectClass * obj, size_t index) TObjectTypeHandler CObjectClassesHandler::loadSubObjectFromJson(const std::string & scope, const std::string & identifier, const JsonNode & entry, ObjectClass * obj, size_t index)