1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-21 08:23:53 +00:00

Merge branch 'no_assert_but_if_instead' into 'master'

Use an `if` instead of an assert

See merge request OpenMW/openmw!1820
This commit is contained in:
jvoisin 2022-05-02 21:17:25 +00:00
commit b4fca045c6

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)) if (!reader.getExact(mData.version) || !reader.getExact(mData.records) || !reader.getExact(mData.nextObjectId))
throw std::runtime_error("TES4 HEDR data read error"); throw std::runtime_error("TES4 HEDR data read error");
if ((size_t)subHdr.dataSize != sizeof(mData.version)+sizeof(mData.records)+sizeof(mData.nextObjectId))
assert((size_t)subHdr.dataSize == sizeof(mData.version)+sizeof(mData.records)+sizeof(mData.nextObjectId) throw std::runtime_error("TES4 HEDR data size mismatch");
&& "TES4 HEDR data size mismatch");
break; break;
} }
case ESM4::SUB_CNAM: reader.getZString(mAuthor); break; case ESM4::SUB_CNAM: reader.getZString(mAuthor); break;