mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-21 06:53: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:
commit
b4fca045c6
1 changed files with 2 additions and 3 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue