1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-21 18:40:01 +00:00

Use an if instead of an assert

This commit is contained in:
jvoisin 2022-05-02 21:17:24 +00:00
parent 699c1db1d8
commit 143dcad0e8

View File

@ -53,9 +53,8 @@ void ESM4::Header::load(ESM4::Reader& reader)
{
if (!reader.getExact(mData.version) || !reader.getExact(mData.records) || !reader.getExact(mData.nextObjectId))
throw std::runtime_error("TES4 HEDR data read error");
assert((size_t)subHdr.dataSize == sizeof(mData.version)+sizeof(mData.records)+sizeof(mData.nextObjectId)
&& "TES4 HEDR data size mismatch");
if ((size_t)subHdr.dataSize != sizeof(mData.version)+sizeof(mData.records)+sizeof(mData.nextObjectId))
throw std::runtime_error("TES4 HEDR data size mismatch");
break;
}
case ESM4::SUB_CNAM: reader.getZString(mAuthor); break;