Make sure scriptstring arrays are being reallocated when they are reusable so if it is being referenced again the scriptstring indices are the ones of the zone instead of the asset that originally loaded them

This commit is contained in:
Jan committed 2020-10-23 12:54:18 +02:00
1 parent 6cca45fc26
commit 3cfcfa0c5d
3 files changed
+33 -2

No files matched your search

@@ -40,7 +40,12 @@ $TypeVarName(structure.Type)$->$member.Member.Name$$PrintArrayIndices(reference)
$\n$
varScriptString = $TypeVarName(structure.Type)$->$member.Member.Name$$PrintArrayIndices(reference)$;$\n$
$if(!member.IsReusable)$
LoadScriptStringArray(true, $PrintEvaluation(reference.ArrayPointerCountEvaluation)$);
$else$
LoadScriptStringArrayRealloc(true, $PrintEvaluation(reference.ArrayPointerCountEvaluation)$);$\n$
$TypeVarName(structure.Type)$->$member.Member.Name$$PrintArrayIndices(reference)$ = varScriptString;
$endif$
%>
@@ -70,6 +75,11 @@ if($TypeVarName(structure.Type)$->$member.Member.Name$$PrintArrayIndices(referen
else
{
$TypeVarName(structure.Type)$->$member.Member.Name$$PrintArrayIndices(reference)$ = m_stream->ConvertOffsetToPointer($TypeVarName(structure.Type)$->$member.Member.Name$$PrintArrayIndices(reference)$);
$if(member.IsScriptString)$
varScriptString = $TypeVarName(structure.Type)$->$member.Member.Name$$PrintArrayIndices(reference)$;
LoadScriptStringArrayRealloc(false, $PrintEvaluation(reference.ArrayPointerCountEvaluation)$);
$TypeVarName(structure.Type)$->$member.Member.Name$$PrintArrayIndices(reference)$ = varScriptString;
$endif$
}$\\$
$endif$
>>