AI in Discord brought up that Import/CopySubkeys doesn't do what you want if you want to merge together KVs. Although it does copy the foreign data in, it also replaces the existing data when it does so. To get around this, his workaround was to manually iterate, create, and import:
if (!hKVSource.GotoFirstSubKey(false)) {
return;
}
char sSectionName[256];
do {
hKVSource.GetSectionName(sSectionName, sizeof(sSectionName));
hKVDestination.JumpToKey(sSectionName, true);
hKVDestination.Import(hKVSource);
hKVDestination.GoBack();
} while (hKVSource.GotoNextKey(false));
With this PR, you should be able to just do hKVDestination.Merge(hKVSource).
AI in Discord brought up that
Import
/CopySubkeys
doesn't do what you want if you want to merge together KVs. Although it does copy the foreign data in, it also replaces the existing data when it does so. To get around this, his workaround was to manually iterate, create, and import:With this PR, you should be able to just do
hKVDestination.Merge(hKVSource)
.