mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-21 06:39:42 +00:00
Ignore extra bytes after the SCVR string list (Fixes #2184)
This commit is contained in:
parent
416d549568
commit
3f0bc6eecb
1 changed files with 8 additions and 1 deletions
|
@ -30,7 +30,14 @@ void Script::load(ESMReader &esm)
|
|||
int s = mData.mStringTableSize;
|
||||
|
||||
std::vector<char> tmp (s);
|
||||
esm.getHExact (&tmp[0], s);
|
||||
// not using getHExact, vanilla doesn't seem to mind unused bytes at the end
|
||||
esm.getSubHeader();
|
||||
int left = esm.getSubSize();
|
||||
if (left < s)
|
||||
esm.fail("SCVR string list is smaller than specified");
|
||||
esm.getExact(&tmp[0], s);
|
||||
if (left > s)
|
||||
esm.skip(left-s); // skip the leftover junk
|
||||
|
||||
// Set up the list of variable names
|
||||
mVarNames.resize(mData.mNumShorts + mData.mNumLongs + mData.mNumFloats);
|
||||
|
|
Loading…
Reference in a new issue