From 2a1d520c9ee860a3c378b30a125411880152761b Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Mon, 17 Jul 2023 19:37:28 +0200 Subject: [PATCH] Address feedback --- components/esm3/loadskil.cpp | 6 ++++-- components/esm3/npcstats.cpp | 2 +- components/esm3/player.cpp | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/components/esm3/loadskil.cpp b/components/esm3/loadskil.cpp index 06e5371ac7..8661230e8c 100644 --- a/components/esm3/loadskil.cpp +++ b/components/esm3/loadskil.cpp @@ -5,6 +5,8 @@ #include +#include + namespace ESM { const SkillId Skill::Block("Block"); @@ -42,7 +44,7 @@ namespace ESM bool hasIndex = false; bool hasData = false; - int index = -1; + int32_t index = -1; while (esm.hasMoreSubs()) { esm.getSubName(); @@ -89,7 +91,7 @@ namespace ESM mDescription.clear(); } - static const RefId sSkills[] = { + static const RefId sSkills[Skill::Length] = { Skill::Block, Skill::Armorer, Skill::MediumArmor, diff --git a/components/esm3/npcstats.cpp b/components/esm3/npcstats.cpp index e2ee4f50d4..c34205f6c2 100644 --- a/components/esm3/npcstats.cpp +++ b/components/esm3/npcstats.cpp @@ -49,7 +49,7 @@ namespace ESM mWerewolfDeprecatedData = true; std::vector> skills(mSkills.begin(), mSkills.end()); - for (int i = 0; i < ESM::Skill::Length; ++i) + for (size_t i = 0; i < std::size(mSkills); ++i) { StatState skill; skill.load(esm, intFallback); diff --git a/components/esm3/player.cpp b/components/esm3/player.cpp index 9c2cad86d1..3b52f8d779 100644 --- a/components/esm3/player.cpp +++ b/components/esm3/player.cpp @@ -54,7 +54,7 @@ namespace ESM = esm.getFormatVersion() <= MaxClearModifiersFormatVersion && !mObject.mNpcStats.mIsWerewolf; if (esm.hasMoreSubs()) { - for (int i = 0; i < Attribute::Length; ++i) + for (size_t i = 0; i < std::size(mSaveAttributes); ++i) { StatState attribute; attribute.load(esm, intFallback); @@ -64,7 +64,7 @@ namespace ESM if (mObject.mNpcStats.mIsWerewolf) mObject.mCreatureStats.mAttributes[i] = attribute; } - for (int i = 0; i < Skill::Length; ++i) + for (size_t i = 0; i < std::size(mSaveSkills); ++i) { StatState skill; skill.load(esm, intFallback);