Use fixed size enum type for ESM::Dialogue::mType

depth-refraction
elsid 2 years ago
parent 4716583f3e
commit 06f42ba69c
No known key found for this signature in database
GPG Key ID: 4DE04C198CBA7625

@ -12,6 +12,7 @@
#include <apps/opencs/model/world/cell.hpp> #include <apps/opencs/model/world/cell.hpp>
#include <components/esm/defs.hpp> #include <components/esm/defs.hpp>
#include <components/esm3/loadbody.hpp> #include <components/esm3/loadbody.hpp>
#include <components/esm3/loaddial.hpp>
#include <components/esm3/loadinfo.hpp> #include <components/esm3/loadinfo.hpp>
#include <components/esm3/loadrace.hpp> #include <components/esm3/loadrace.hpp>
#include <components/esm3/loadskil.hpp> #include <components/esm3/loadskil.hpp>
@ -1342,7 +1343,7 @@ namespace CSMWorld
{ {
ESXRecordT record2 = record.get(); ESXRecordT record2 = record.get();
record2.mType = data.toInt(); record2.mType = static_cast<ESM::Dialogue::Type>(data.toInt());
record.setModified(record2); record.setModified(record2);
} }

@ -30,7 +30,7 @@ namespace ESM
/// Return a string descriptor for this record type. Currently used for debugging / error logs only. /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
static std::string_view getRecordType() { return "Dialogue"; } static std::string_view getRecordType() { return "Dialogue"; }
enum Type enum Type : std::int8_t
{ {
Topic = 0, Topic = 0,
Voice = 1, Voice = 1,
@ -41,7 +41,7 @@ namespace ESM
}; };
RefId mId; RefId mId;
signed char mType; Type mType;
InfoContainer mInfo; InfoContainer mInfo;
InfoOrder<DialInfo> mInfoOrder; InfoOrder<DialInfo> mInfoOrder;

Loading…
Cancel
Save