mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-28 12:09:53 +00:00
Allow GMSTs with empty EDID
This commit is contained in:
parent
22cc7f3020
commit
7e1e43f9c6
3 changed files with 10 additions and 2 deletions
|
@ -97,6 +97,11 @@ namespace EsmTool
|
|||
return stream << " ?";
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& stream, const std::monostate&)
|
||||
{
|
||||
return stream << "[none]";
|
||||
}
|
||||
|
||||
std::ostream& operator<<(std::ostream& stream, const WriteData<ESM4::GameSetting::Data>& write)
|
||||
{
|
||||
std::visit([&](const auto& v) { stream << v; }, write.mValue);
|
||||
|
|
|
@ -13,7 +13,10 @@ namespace ESM4
|
|||
GameSetting::Data readData(FormId formId, std::string_view editorId, Reader& reader)
|
||||
{
|
||||
if (editorId.empty())
|
||||
throw std::runtime_error("Unknown ESM4 GMST (" + formId.toString() + ") data type: editor id is empty");
|
||||
{
|
||||
reader.skipSubRecordData();
|
||||
return std::monostate{};
|
||||
}
|
||||
const char type = editorId[0];
|
||||
switch (type)
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace ESM4
|
|||
|
||||
struct GameSetting
|
||||
{
|
||||
using Data = std::variant<bool, float, std::int32_t, std::string>;
|
||||
using Data = std::variant<std::monostate, bool, float, std::int32_t, std::string>;
|
||||
|
||||
FormId mFormId; // from the header
|
||||
std::uint32_t mFlags; // from the header, see enum type RecordFlag for details
|
||||
|
|
Loading…
Reference in a new issue