mirror of
https://github.com/vcmi/vcmi.git
synced 2024-12-24 22:14:36 +02:00
Fixes 1852 - fixed typo in tower config and added check to detect such cases
This commit is contained in:
parent
68e9cbd3a6
commit
33acdc51bb
@ -180,7 +180,7 @@
|
||||
"dwellingLvl4": { "id" : 33, "requires" : [ "allOf", [ "mageGuild1" ], [ "dwellingLvl2" ], [ "dwellingLvl3" ] ] },
|
||||
"dwellingLvl5": { "id" : 34, "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" },
|
||||
"dwellingUpLvl2": { "id" : 38, "upgrades" : "dwellingLvl2" },
|
||||
|
@ -745,8 +745,13 @@ void CTownHandler::initializeRequirements()
|
||||
// must be done separately after all ID's are known
|
||||
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());
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user