ZoneLoading: Fix not being able to load a null scriptstring and aligning incorrectly when loading the header

This commit is contained in:
Jan 2019-12-23 17:05:12 +01:00
parent af56d9193d
commit 2fea7654a9

View File

@ -75,14 +75,21 @@ void ContentLoaderT6::LoadScriptStringList(const bool atStreamStart)
{ {
assert(varScriptStringList->strings == PTR_FOLLOWING); assert(varScriptStringList->strings == PTR_FOLLOWING);
varScriptStringList->strings = m_stream->Alloc<const char*>(alignof(const char)); varScriptStringList->strings = m_stream->Alloc<const char*>(alignof(const char*));
varXString = varScriptStringList->strings; varXString = varScriptStringList->strings;
LoadXStringArray(true, varScriptStringList->count); LoadXStringArray(true, varScriptStringList->count);
for(int i = 0; i < varScriptStringList->count; i++) for(int i = 0; i < varScriptStringList->count; i++)
{
if(varScriptStringList->strings[i])
{ {
m_script_strings.emplace_back(varScriptStringList->strings[i]); m_script_strings.emplace_back(varScriptStringList->strings[i]);
} }
else
{
m_script_strings.emplace_back("");
}
}
} }
m_stream->PopBlock(); m_stream->PopBlock();
@ -216,7 +223,7 @@ void ContentLoaderT6::Load(Zone* zone, IZoneInputStream* stream)
{ {
assert(assetList.depends == PTR_FOLLOWING); assert(assetList.depends == PTR_FOLLOWING);
assetList.depends = m_stream->Alloc<const char*>(alignof(const char)); assetList.depends = m_stream->Alloc<const char*>(alignof(const char*));
varXString = assetList.depends; varXString = assetList.depends;
LoadXStringArray(true, assetList.dependCount); LoadXStringArray(true, assetList.dependCount);
} }