mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-21 00:25:44 +00:00
Fix ZoneCode array loading overwriting pointers when an array is loaded while inside of an array of the same type
This commit is contained in:
parent
8778421ebb
commit
4aafbac113
@ -153,11 +153,13 @@ void $LoaderClassName(context.Asset)$::LoadPtrArray_$SafeTypeName(type)$(const b
|
|||||||
if(atStreamStart)
|
if(atStreamStart)
|
||||||
m_stream->Load<$type.FullName$*>($TypePtrVarName(type)$, count);
|
m_stream->Load<$type.FullName$*>($TypePtrVarName(type)$, count);
|
||||||
|
|
||||||
|
$type.FullName$** var = $TypePtrVarName(type)$;
|
||||||
for(size_t index = 0; index < count; index++)
|
for(size_t index = 0; index < count; index++)
|
||||||
{
|
{
|
||||||
|
$TypePtrVarName(type)$ = var;
|
||||||
$LoadPointerArrayMethod_PointerCheck(context, type, structure, reusable)$
|
$LoadPointerArrayMethod_PointerCheck(context, type, structure, reusable)$
|
||||||
|
|
||||||
$TypePtrVarName(type)$++;
|
var++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
>>
|
>>
|
@ -236,13 +236,16 @@ void $LoaderClassName(context.Asset)$::LoadArray_$type.Name$(const bool atStream
|
|||||||
if(atStreamStart)
|
if(atStreamStart)
|
||||||
m_stream->Load<$type.FullName$>($TypeVarName(type)$, count);
|
m_stream->Load<$type.FullName$>($TypeVarName(type)$, count);
|
||||||
|
|
||||||
|
$type.FullName$* var = $TypeVarName(type)$;
|
||||||
for(size_t index = 0; index < count; index++)
|
for(size_t index = 0; index < count; index++)
|
||||||
{
|
{
|
||||||
$if(!type.Members)$
|
$if(!type.Members)$
|
||||||
$TypeVarName(structure.Type)$ = $TypeVarName(type)$;
|
$TypeVarName(structure.Type)$ = var;
|
||||||
|
$else$
|
||||||
|
$TypeVarName(type)$ = var;
|
||||||
$endif$
|
$endif$
|
||||||
Load_$structure.Type.Name$(false);
|
Load_$structure.Type.Name$(false);
|
||||||
$TypeVarName(type)$++;
|
var++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
>>
|
>>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user