1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-21 00:19:29 +02:00
- minor fix to json arrays merging
- fixed update of growth icons on town screen
This commit is contained in:
Ivan Savenko
2013-05-30 18:43:45 +00:00
parent 3943c10f1a
commit 4724ccbb45
4 changed files with 27 additions and 17 deletions

View File

@ -1570,12 +1570,12 @@ void JsonUtils::merge(JsonNode & dest, JsonNode & source)
for (size_t i=0; i< total; i++)
merge(dest.Vector()[i], source.Vector()[i]);
if (source.Vector().size() < dest.Vector().size())
if (dest.Vector().size() < source.Vector().size())
{
//reserve place and *move* data from source to dest
//reserve place and *move* remaining data from source to dest
source.Vector().reserve(source.Vector().size() + dest.Vector().size());
std::move(source.Vector().begin(), source.Vector().end(),
std::move(source.Vector().begin() + total, source.Vector().end(),
std::back_inserter(dest.Vector()));
}
break;