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:
Jan 2020-09-09 16:12:20 +02:00
parent 8778421ebb
commit 4aafbac113
2 changed files with 8 additions and 3 deletions

View File

@ -153,11 +153,13 @@ void $LoaderClassName(context.Asset)$::LoadPtrArray_$SafeTypeName(type)$(const b
if(atStreamStart)
m_stream->Load<$type.FullName$*>($TypePtrVarName(type)$, count);
$type.FullName$** var = $TypePtrVarName(type)$;
for(size_t index = 0; index < count; index++)
{
$TypePtrVarName(type)$ = var;
$LoadPointerArrayMethod_PointerCheck(context, type, structure, reusable)$
$TypePtrVarName(type)$++;
var++;
}
}
>>

View File

@ -236,13 +236,16 @@ void $LoaderClassName(context.Asset)$::LoadArray_$type.Name$(const bool atStream
if(atStreamStart)
m_stream->Load<$type.FullName$>($TypeVarName(type)$, count);
$type.FullName$* var = $TypeVarName(type)$;
for(size_t index = 0; index < count; index++)
{
$if(!type.Members)$
$TypeVarName(structure.Type)$ = $TypeVarName(type)$;
$TypeVarName(structure.Type)$ = var;
$else$
$TypeVarName(type)$ = var;
$endif$
Load_$structure.Type.Name$(false);
$TypeVarName(type)$++;
var++;
}
}
>>