diff --git a/components/esm3/cellref.cpp b/components/esm3/cellref.cpp index 9b46bf182a..d5ed0b4003 100644 --- a/components/esm3/cellref.cpp +++ b/components/esm3/cellref.cpp @@ -116,7 +116,7 @@ namespace ESM if constexpr (load) esm.getHTSized<24>(cellRef.mPos); else - esm.skip(24); + esm.skipHTSized<24, decltype(cellRef.mPos)>(); break; case ESM::fourCC("NAM0"): { diff --git a/components/esm3/esmreader.hpp b/components/esm3/esmreader.hpp index e931cde42a..ffa7a94d7b 100644 --- a/components/esm3/esmreader.hpp +++ b/components/esm3/esmreader.hpp @@ -155,6 +155,13 @@ public: getHT(x); } + template + void skipHTSized() + { + static_assert(sizeof(T) == size); + skipHT(); + } + // Read a string by the given name if it is the next record. std::string getHNOString(NAME name);