mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-21 00:25:44 +00:00
ZoneCodeGenerator: Fix LoadTempPtr method doing insertpointer and allocating in the wrong order
This commit is contained in:
parent
92e84e69f9
commit
a7936c9eaa
@ -176,18 +176,15 @@ void $LoaderClassName(context.Asset)$::LoadPtr_$structure.Type.Name$(const bool
|
|||||||
|
|
||||||
if(*$TypePtrVarName(structure.Type)$ != nullptr)
|
if(*$TypePtrVarName(structure.Type)$ != nullptr)
|
||||||
{
|
{
|
||||||
$if(structure.Block.IsTemp)$
|
|
||||||
if(*$TypePtrVarName(structure.Type)$ == PTR_FOLLOWING || *$TypePtrVarName(structure.Type)$ == PTR_INSERT)
|
if(*$TypePtrVarName(structure.Type)$ == PTR_FOLLOWING || *$TypePtrVarName(structure.Type)$ == PTR_INSERT)
|
||||||
$else$
|
|
||||||
if(*$TypePtrVarName(structure.Type)$ == PTR_FOLLOWING)
|
|
||||||
$endif$
|
|
||||||
{
|
{
|
||||||
$structure.Type.FullName$** toInsert = nullptr;
|
$structure.Type.FullName$* ptr = *$TypePtrVarName(structure.Type)$;
|
||||||
if(*$TypePtrVarName(structure.Type)$ == PTR_INSERT)
|
|
||||||
toInsert = m_stream->InsertPointer<$structure.Type.FullName$>();
|
|
||||||
|
|
||||||
*$TypePtrVarName(structure.Type)$ = m_stream->Alloc<$structure.Type.FullName$>(alignof($structure.Type.FullName$));
|
*$TypePtrVarName(structure.Type)$ = m_stream->Alloc<$structure.Type.FullName$>(alignof($structure.Type.FullName$));
|
||||||
|
|
||||||
|
$structure.Type.FullName$** toInsert = nullptr;
|
||||||
|
if(ptr == PTR_INSERT)
|
||||||
|
toInsert = m_stream->InsertPointer<$structure.Type.FullName$>();
|
||||||
|
|
||||||
$if(!structure.IsLeaf)$
|
$if(!structure.IsLeaf)$
|
||||||
$TypeVarName(structure.Type)$ = *$TypePtrVarName(structure.Type)$;
|
$TypeVarName(structure.Type)$ = *$TypePtrVarName(structure.Type)$;
|
||||||
Load_$structure.Type.Name$(true);
|
Load_$structure.Type.Name$(true);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user