diff --git a/apps/esmtool/tes4.cpp b/apps/esmtool/tes4.cpp index 8eaf1b3464..11c3249d44 100644 --- a/apps/esmtool/tes4.cpp +++ b/apps/esmtool/tes4.cpp @@ -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& write) { std::visit([&](const auto& v) { stream << v; }, write.mValue); diff --git a/components/esm4/loadgmst.cpp b/components/esm4/loadgmst.cpp index f7185dc2fd..d58c6d3d87 100644 --- a/components/esm4/loadgmst.cpp +++ b/components/esm4/loadgmst.cpp @@ -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) { diff --git a/components/esm4/loadgmst.hpp b/components/esm4/loadgmst.hpp index 552e8e6395..68095404a3 100644 --- a/components/esm4/loadgmst.hpp +++ b/components/esm4/loadgmst.hpp @@ -13,7 +13,7 @@ namespace ESM4 struct GameSetting { - using Data = std::variant; + using Data = std::variant; FormId mFormId; // from the header std::uint32_t mFlags; // from the header, see enum type RecordFlag for details diff --git a/components/esm4/loadidlm.cpp b/components/esm4/loadidlm.cpp index b036edc7d6..70321d790f 100644 --- a/components/esm4/loadidlm.cpp +++ b/components/esm4/loadidlm.cpp @@ -76,7 +76,12 @@ void ESM4::IdleMarker::load(ESM4::Reader& reader) reader.getFormId(value); break; } + case ESM4::SUB_MODL: + reader.getZString(mModel); + break; case ESM4::SUB_OBND: // object bounds + case ESM4::SUB_MODT: + case ESM4::SUB_MODS: reader.skipSubRecordData(); break; default: diff --git a/components/esm4/loadligh.cpp b/components/esm4/loadligh.cpp index bb12666219..6fc86a8685 100644 --- a/components/esm4/loadligh.cpp +++ b/components/esm4/loadligh.cpp @@ -102,6 +102,12 @@ void ESM4::Light::load(ESM4::Reader& reader) case ESM4::SUB_MODT: case ESM4::SUB_OBND: case ESM4::SUB_VMAD: // Dragonborn only? + case ESM4::SUB_DEST: // Destruction data start + case ESM4::SUB_DSTD: + case ESM4::SUB_DMDL: + case ESM4::SUB_DMDT: + case ESM4::SUB_DMDS: + case ESM4::SUB_DSTF: // Destruction data end reader.skipSubRecordData(); break; default: diff --git a/components/esm4/loadmisc.cpp b/components/esm4/loadmisc.cpp index c0f803855f..45e87d5446 100644 --- a/components/esm4/loadmisc.cpp +++ b/components/esm4/loadmisc.cpp @@ -78,6 +78,12 @@ void ESM4::MiscItem::load(ESM4::Reader& reader) case ESM4::SUB_OBND: case ESM4::SUB_VMAD: case ESM4::SUB_RNAM: // FONV + case ESM4::SUB_DEST: // Destruction data start + case ESM4::SUB_DSTD: + case ESM4::SUB_DMDL: + case ESM4::SUB_DMDT: + case ESM4::SUB_DMDS: + case ESM4::SUB_DSTF: // Destruction data end reader.skipSubRecordData(); break; default: diff --git a/components/esm4/loadscrl.cpp b/components/esm4/loadscrl.cpp index 9dde36916e..194edf0868 100644 --- a/components/esm4/loadscrl.cpp +++ b/components/esm4/loadscrl.cpp @@ -58,6 +58,12 @@ void ESM4::Scroll::load(ESM4::Reader& reader) case ESM4::SUB_MODL: reader.getZString(mModel); break; + case ESM4::SUB_YNAM: + reader.getFormId(mPickUpSound); + break; + case ESM4::SUB_ZNAM: + reader.getFormId(mDropSound); + break; // case ESM4::SUB_MODB: reader.get(mBoundRadius); break; case ESM4::SUB_OBND: case ESM4::SUB_CTDA: diff --git a/components/esm4/loadscrl.hpp b/components/esm4/loadscrl.hpp index a7d6b015af..21e5e8ccba 100644 --- a/components/esm4/loadscrl.hpp +++ b/components/esm4/loadscrl.hpp @@ -53,6 +53,9 @@ namespace ESM4 std::string mModel; std::string mText; + FormId mPickUpSound; + FormId mDropSound; + Data mData; void load(ESM4::Reader& reader); diff --git a/components/esm4/loadtact.cpp b/components/esm4/loadtact.cpp index 5bf5c45cab..aeea62bf05 100644 --- a/components/esm4/loadtact.cpp +++ b/components/esm4/loadtact.cpp @@ -70,6 +70,8 @@ void ESM4::TalkingActivator::load(ESM4::Reader& reader) case ESM4::SUB_PNAM: case ESM4::SUB_MODT: // texture file hash? case ESM4::SUB_OBND: + case ESM4::SUB_VMAD: + case ESM4::SUB_MODS: reader.skipSubRecordData(); break; default: