1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-16 16:20:53 +00:00

Merge branch 'another_assert' into 'master'

Replace another assert with a throw

See merge request OpenMW/openmw!3064
This commit is contained in:
psi29a 2023-05-26 12:04:32 +00:00
commit 6af3ddfb56

View File

@ -30,7 +30,6 @@
#undef NDEBUG
#endif
#include <cassert>
#include <cfloat> // FLT_MAX for gcc
#include <iostream> // FIXME: debug only
#include <limits>
@ -140,7 +139,8 @@ void ESM4::Cell::load(ESM4::Reader& reader)
reader.get(mCellFlags);
else
{
assert(subHdr.dataSize == 1 && "CELL unexpected DATA flag size");
if (subHdr.dataSize != 1)
throw std::runtime_error("CELL unexpected DATA flag size");
reader.get(&mCellFlags, sizeof(std::uint8_t));
}
else