1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

More string ID's for buildings:

- town hall slots now use string ID's
- converted building requirements to new format
- "upgrades" property from buildings now uses string ID's
- several fixes for improved support of alternative creatures
- removed no longer needed "id" property from structures

Old mods should still work but will produce error messages during
validation
This commit is contained in:
Ivan Savenko
2013-12-04 10:36:39 +00:00
parent b1e638d1af
commit 122db9963b
17 changed files with 753 additions and 701 deletions

View File

@@ -715,25 +715,9 @@ void JsonUtils::merge(JsonNode & dest, JsonNode & source)
case JsonNode::DATA_BOOL:
case JsonNode::DATA_FLOAT:
case JsonNode::DATA_STRING:
{
std::swap(dest, source);
break;
}
case JsonNode::DATA_VECTOR:
{
size_t total = std::min(source.Vector().size(), dest.Vector().size());
for (size_t i=0; i< total; i++)
merge(dest.Vector()[i], source.Vector()[i]);
if (dest.Vector().size() < source.Vector().size())
{
//reserve place and *move* remaining data from source to dest
source.Vector().reserve(source.Vector().size() + dest.Vector().size());
std::move(source.Vector().begin() + total, source.Vector().end(),
std::back_inserter(dest.Vector()));
}
std::swap(dest, source);
break;
}
case JsonNode::DATA_STRUCT: