1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-28 12:40:06 +00:00

Avoid casts to read cell flags

This commit is contained in:
elsid 2023-07-30 17:41:23 +02:00
parent d2f16774d9
commit fd01b4cad7
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

View File

@ -136,11 +136,15 @@ void ESM4::Cell::load(ESM4::Reader& reader)
{ {
if (subHdr.dataSize != 1) if (subHdr.dataSize != 1)
throw std::runtime_error("CELL unexpected DATA flag size"); throw std::runtime_error("CELL unexpected DATA flag size");
reader.get(&mCellFlags, sizeof(std::uint8_t)); std::uint8_t value = 0;
reader.get(value);
mCellFlags = value;
} }
else else
{ {
reader.get((std::uint8_t&)mCellFlags); // 8 bits in Obvlivion std::uint8_t value = 0;
reader.get(value); // 8 bits in Obvlivion
mCellFlags = value;
} }
#if 0 #if 0
std::string padding; std::string padding;