From 8d655054f127416d915f6e8f992c2fb08554bace Mon Sep 17 00:00:00 2001 From: Alexei Kotov Date: Mon, 25 Sep 2023 20:45:39 +0300 Subject: [PATCH] esmtool: Print human-readable ESM4 file format version --- apps/esmtool/tes4.cpp | 2 +- components/esm4/reader.hpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/esmtool/tes4.cpp b/apps/esmtool/tes4.cpp index 6791694a7c..5b657da573 100644 --- a/apps/esmtool/tes4.cpp +++ b/apps/esmtool/tes4.cpp @@ -562,7 +562,7 @@ namespace EsmTool { std::cout << "Author: " << reader.getAuthor() << '\n' << "Description: " << reader.getDesc() << '\n' - << "File format version: " << reader.esmVersion() << '\n'; + << "File format version: " << reader.esmVersionF() << '\n'; if (const std::vector& masterData = reader.getGameFiles(); !masterData.empty()) { diff --git a/components/esm4/reader.hpp b/components/esm4/reader.hpp index e18c614885..c63dbd1548 100644 --- a/components/esm4/reader.hpp +++ b/components/esm4/reader.hpp @@ -247,6 +247,7 @@ namespace ESM4 void setRecHeaderSize(const std::size_t size); inline unsigned int esmVersion() const { return mHeader.mData.version.ui; } + inline float esmVersionF() const { return mHeader.mData.version.f; } inline unsigned int numRecords() const { return mHeader.mData.records; } inline bool hasFormVersion() const { return mCtx.recHeaderSize == sizeof(RecordHeader); }