mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-21 00:25:44 +00: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:
parent
a2ef445455
commit
d99eb0ab24
@ -865,9 +865,13 @@ class ZoneWriteTemplate::Internal final : BaseTemplate
|
|||||||
m_intendation++;
|
m_intendation++;
|
||||||
|
|
||||||
LINE("assert(pAsset != nullptr);")
|
LINE("assert(pAsset != nullptr);")
|
||||||
|
LINE("assert(m_asset != nullptr);")
|
||||||
|
LINE("assert(m_asset->m_ptr != nullptr);")
|
||||||
LINE("")
|
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("WritePtr_" << MakeSafeTypeName(m_env.m_asset->m_definition) << "(false);")
|
||||||
|
LINE("*pAsset = zoneAsset;")
|
||||||
|
|
||||||
m_intendation--;
|
m_intendation--;
|
||||||
LINE("}")
|
LINE("}")
|
||||||
|
@ -8,9 +8,9 @@
|
|||||||
|
|
||||||
class AssetWriter : public ContentWriterBase
|
class AssetWriter : public ContentWriterBase
|
||||||
{
|
{
|
||||||
|
protected:
|
||||||
XAssetInfoGeneric* m_asset;
|
XAssetInfoGeneric* m_asset;
|
||||||
|
|
||||||
protected:
|
|
||||||
scr_string_t* varScriptString;
|
scr_string_t* varScriptString;
|
||||||
|
|
||||||
AssetWriter(XAssetInfoGeneric* asset, Zone* zone, IZoneOutputStream* stream);
|
AssetWriter(XAssetInfoGeneric* asset, Zone* zone, IZoneOutputStream* stream);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user