mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-21 00:19:29 +02:00
- fixes #1276
- minor fix to json arrays merging - fixed update of growth icons on town screen
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user