mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-11 03:36:42 +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 << " ?";
|
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::ostream& operator<<(std::ostream& stream, const WriteData<ESM4::GameSetting::Data>& write)
|
||||||
{
|
{
|
||||||
std::visit([&](const auto& v) { stream << v; }, write.mValue);
|
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)
|
GameSetting::Data readData(FormId formId, std::string_view editorId, Reader& reader)
|
||||||
{
|
{
|
||||||
if (editorId.empty())
|
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];
|
const char type = editorId[0];
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,7 +13,7 @@ namespace ESM4
|
||||||
|
|
||||||
struct GameSetting
|
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
|
FormId mFormId; // from the header
|
||||||
std::uint32_t mFlags; // from the header, see enum type RecordFlag for details
|
std::uint32_t mFlags; // from the header, see enum type RecordFlag for details
|
||||||
|
|
Loading…
Reference in a new issue