fix: not accessing previous zone data when taking an asset from global asset pools

This commit is contained in:
Jan 2025-01-11 11:57:09 +01:00
parent 36f0764cd5
commit c86f9f6391
No known key found for this signature in database
GPG Key ID: 44B581F78FF5C57C

View File

@ -38,7 +38,12 @@ public:
for (const auto scrString : existingAsset->m_used_script_strings) for (const auto scrString : existingAsset->m_used_script_strings)
m_zone.m_script_strings.AddOrGetScriptString(existingAsset->m_zone->m_script_strings.CValue(scrString)); m_zone.m_script_strings.AddOrGetScriptString(existingAsset->m_zone->m_script_strings.CValue(scrString));
return AssetCreationResult::Success(context.AddAsset(std::move(registration))); auto* newAsset = context.AddAsset(std::move(registration));
// Make sure we remember this asset came from another zone
newAsset->m_zone = existingAsset->m_zone;
return AssetCreationResult::Success(newAsset);
} }
private: private: