mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Fixes 1852 - fixed typo in tower config and added check to detect such cases
This commit is contained in:
@@ -180,7 +180,7 @@
|
|||||||
"dwellingLvl4": { "id" : 33, "requires" : [ "allOf", [ "mageGuild1" ], [ "dwellingLvl2" ], [ "dwellingLvl3" ] ] },
|
"dwellingLvl4": { "id" : 33, "requires" : [ "allOf", [ "mageGuild1" ], [ "dwellingLvl2" ], [ "dwellingLvl3" ] ] },
|
||||||
"dwellingLvl5": { "id" : 34, "requires" : [ "dwellingLvl4" ] },
|
"dwellingLvl5": { "id" : 34, "requires" : [ "dwellingLvl4" ] },
|
||||||
"dwellingLvl6": { "id" : 35, "requires" : [ "dwellingLvl4" ] },
|
"dwellingLvl6": { "id" : 35, "requires" : [ "dwellingLvl4" ] },
|
||||||
"dwellingLvl7": { "id" : 36, "requires" : [ "dwellingLvl5", "dwellingLvl6" ] },
|
"dwellingLvl7": { "id" : 36, "requires" : [ "allOf", [ "dwellingLvl5" ], [ "dwellingLvl6" ] ] },
|
||||||
|
|
||||||
"dwellingUpLvl1": { "id" : 37, "upgrades" : "dwellingLvl1" },
|
"dwellingUpLvl1": { "id" : 37, "upgrades" : "dwellingLvl1" },
|
||||||
"dwellingUpLvl2": { "id" : 38, "upgrades" : "dwellingLvl2" },
|
"dwellingUpLvl2": { "id" : 38, "upgrades" : "dwellingLvl2" },
|
||||||
|
|||||||
@@ -745,8 +745,13 @@ void CTownHandler::initializeRequirements()
|
|||||||
// must be done separately after all ID's are known
|
// must be done separately after all ID's are known
|
||||||
for (auto & requirement : requirementsToLoad)
|
for (auto & requirement : requirementsToLoad)
|
||||||
{
|
{
|
||||||
requirement.building->requirements = CBuilding::TRequired(requirement.json, [&](const JsonNode & node)
|
requirement.building->requirements = CBuilding::TRequired(requirement.json, [&](const JsonNode & node) -> BuildingID
|
||||||
{
|
{
|
||||||
|
if (node.Vector().size() > 1)
|
||||||
|
{
|
||||||
|
logGlobal->warnStream() << "Unexpected length of town buildings requirements: " << node.Vector().size();
|
||||||
|
logGlobal->warnStream() << "Entry contains " << node;
|
||||||
|
}
|
||||||
return BuildingID(VLC->modh->identifiers.getIdentifier("building." + requirement.faction->identifier, node.Vector()[0]).get());
|
return BuildingID(VLC->modh->identifiers.getIdentifier("building." + requirement.faction->identifier, node.Vector()[0]).get());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user