diff --git a/apps/esmtool/esmtool.cpp b/apps/esmtool/esmtool.cpp index a968dcb464..a6178d692d 100644 --- a/apps/esmtool/esmtool.cpp +++ b/apps/esmtool/esmtool.cpp @@ -15,6 +15,7 @@ #include #include "record.hpp" +#include "labels.hpp" #define ESMTOOL_VERSION 1.2 @@ -398,7 +399,8 @@ int load(Arguments& info) if(!quiet && interested) { - std::cout << "\nRecord: " << n.toStringView() << " '" << record->getId() << "'\n"; + std::cout << "\nRecord: " << n.toStringView() << " '" << record->getId() << "'\n" + << "Record flags: " << recordFlags(record->getFlags()) << '\n'; record->print(); } diff --git a/apps/esmtool/labels.cpp b/apps/esmtool/labels.cpp index d6cae207c9..405aeb9454 100644 --- a/apps/esmtool/labels.cpp +++ b/apps/esmtool/labels.cpp @@ -902,3 +902,17 @@ std::string weaponFlags(int flags) properties += Misc::StringUtils::format("(0x%08X)", flags); return properties; } + +std::string recordFlags(uint32_t flags) +{ + std::string properties; + if (flags == 0) properties += "[None] "; + if (flags & ESM::FLAG_Deleted) properties += "Deleted "; + if (flags & ESM::FLAG_Persistent) properties += "Persistent "; + if (flags & ESM::FLAG_Ignored) properties += "Ignored "; + if (flags & ESM::FLAG_Blocked) properties += "Blocked "; + int unused = ~(ESM::FLAG_Deleted | ESM::FLAG_Persistent | ESM::FLAG_Ignored | ESM::FLAG_Blocked); + if (flags & unused) properties += "Invalid "; + properties += Misc::StringUtils::format("(0x%08X)", flags); + return properties; +} \ No newline at end of file diff --git a/apps/esmtool/labels.hpp b/apps/esmtool/labels.hpp index b06480a97b..8450ccfa03 100644 --- a/apps/esmtool/labels.hpp +++ b/apps/esmtool/labels.hpp @@ -60,6 +60,8 @@ std::string raceFlags(int flags); std::string spellFlags(int flags); std::string weaponFlags(int flags); +std::string recordFlags(uint32_t flags); + // Missing flags functions: // aiServicesFlags, possibly more diff --git a/components/esmloader/load.cpp b/components/esmloader/load.cpp index 2e54449a2c..2705c43c49 100644 --- a/components/esmloader/load.cpp +++ b/components/esmloader/load.cpp @@ -196,6 +196,11 @@ namespace EsmLoader { const ESM::NAME recName = reader.getRecName(); reader.getRecHeader(); + if (reader.getRecordFlags() & ESM::FLAG_Ignored) + { + reader.skipRecord(); + continue; + } loadRecord(query, recName, reader, content); } }