mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-10 23:08:05 -05:00
Use asset identified by name and type when writing asset dependency to make sure that the pointer always matches one that would have been written to the zone already even when using an asset from another loaded zone
This commit is contained in:
@ -865,9 +865,13 @@ class ZoneWriteTemplate::Internal final : BaseTemplate
|
||||
m_intendation++;
|
||||
|
||||
LINE("assert(pAsset != nullptr);")
|
||||
LINE("assert(m_asset != nullptr);")
|
||||
LINE("assert(m_asset->m_ptr != nullptr);")
|
||||
LINE("")
|
||||
LINE(MakeTypePtrVarName(m_env.m_asset->m_definition) << " = pAsset;")
|
||||
LINE("auto* zoneAsset = static_cast<"<<m_env.m_asset->m_definition->GetFullName()<<"*>(m_asset->m_ptr);")
|
||||
LINE(MakeTypePtrVarName(m_env.m_asset->m_definition) << " = &zoneAsset;")
|
||||
LINE("WritePtr_" << MakeSafeTypeName(m_env.m_asset->m_definition) << "(false);")
|
||||
LINE("*pAsset = zoneAsset;")
|
||||
|
||||
m_intendation--;
|
||||
LINE("}")
|
||||
|
@ -8,9 +8,9 @@
|
||||
|
||||
class AssetWriter : public ContentWriterBase
|
||||
{
|
||||
protected:
|
||||
XAssetInfoGeneric* m_asset;
|
||||
|
||||
protected:
|
||||
scr_string_t* varScriptString;
|
||||
|
||||
AssetWriter(XAssetInfoGeneric* asset, Zone* zone, IZoneOutputStream* stream);
|
||||
|
Reference in New Issue
Block a user