From 32022e9b5c2eb7886d53b2b36740773d68bca786 Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Mon, 24 Jul 2023 01:52:41 +0300 Subject: [PATCH] Read STAT::MNAM --- components/esm4/loadstat.cpp | 13 ++++++++++++- components/esm4/loadstat.hpp | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/components/esm4/loadstat.cpp b/components/esm4/loadstat.cpp index 99ab68bc6e..1edb9471f3 100644 --- a/components/esm4/loadstat.cpp +++ b/components/esm4/loadstat.cpp @@ -69,10 +69,21 @@ void ESM4::Static::load(ESM4::Reader& reader) } break; } + case ESM4::SUB_MNAM: + { + for (std::string& level : mLOD) + { + level.resize(260); + reader.get(level.data(), 260); + size_t end = level.find('\0'); + if (end != std::string::npos) + level.erase(end); + } + break; + } case ESM4::SUB_MODS: case ESM4::SUB_OBND: case ESM4::SUB_DNAM: - case ESM4::SUB_MNAM: case ESM4::SUB_BRUS: // FONV case ESM4::SUB_RNAM: // FONV reader.skipSubRecordData(); diff --git a/components/esm4/loadstat.hpp b/components/esm4/loadstat.hpp index 00f4d08c49..dca07c24e8 100644 --- a/components/esm4/loadstat.hpp +++ b/components/esm4/loadstat.hpp @@ -27,6 +27,7 @@ #ifndef ESM4_STAT_H #define ESM4_STAT_H +#include #include #include #include @@ -53,6 +54,7 @@ namespace ESM4 float mBoundRadius; std::vector mMODT; // FIXME texture hash + std::array mLOD; void load(ESM4::Reader& reader); // void save(ESM4::Writer& writer) const;