Use an `if` instead of an assert

pull/3227/head
jvoisin 3 years ago
parent 699c1db1d8
commit 143dcad0e8

@ -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;

Loading…
Cancel
Save