mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 18:19:55 +00:00
Log a warning if size in SCHD (script header) does not match SCDT (bytecode) size instead of failing
This commit is contained in:
parent
f151eccc23
commit
06dc94552f
1 changed files with 16 additions and 2 deletions
|
@ -83,10 +83,24 @@ namespace ESM
|
||||||
loadSCVR(esm);
|
loadSCVR(esm);
|
||||||
break;
|
break;
|
||||||
case ESM::FourCC<'S','C','D','T'>::value:
|
case ESM::FourCC<'S','C','D','T'>::value:
|
||||||
|
{
|
||||||
// compiled script
|
// compiled script
|
||||||
mScriptData.resize(mData.mScriptDataSize);
|
esm.getSubHeader();
|
||||||
esm.getHExact(&mScriptData[0], mScriptData.size());
|
uint32_t subSize = esm.getSubSize();
|
||||||
|
|
||||||
|
if (subSize != static_cast<uint32_t>(mData.mScriptDataSize))
|
||||||
|
{
|
||||||
|
std::stringstream ss;
|
||||||
|
ss << "ESM Warning: Script data size defined in SCHD subrecord does not match size of SCDT subrecord";
|
||||||
|
ss << "\n File: " << esm.getName();
|
||||||
|
ss << "\n Offset: 0x" << std::hex << esm.getFileOffset();
|
||||||
|
std::cerr << ss.str() << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
mScriptData.resize(subSize);
|
||||||
|
esm.getExact(&mScriptData[0], mScriptData.size());
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case ESM::FourCC<'S','C','T','X'>::value:
|
case ESM::FourCC<'S','C','T','X'>::value:
|
||||||
mScriptText = esm.getHString();
|
mScriptText = esm.getHString();
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue