mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-10 23:08:05 -05:00
ZoneCodeGenerator: Fix LoadTempPtr method doing insertpointer and allocating in the wrong order
This commit is contained in:
@ -176,17 +176,14 @@ 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)$;
|
||||||
|
Reference in New Issue
Block a user