diff --git a/apps/openmw/mwmechanics/npcstats.cpp b/apps/openmw/mwmechanics/npcstats.cpp index 579969f9d..87fb835a7 100644 --- a/apps/openmw/mwmechanics/npcstats.cpp +++ b/apps/openmw/mwmechanics/npcstats.cpp @@ -34,7 +34,6 @@ MWMechanics::NpcStats::NpcStats() , mProfit(0) , mTimeToStartDrowning(20.0) , mLastDrowningHit(0) -, mLevelHealthBonus(0) { mSkillIncreases.resize (ESM::Attribute::Length, 0); } @@ -262,8 +261,7 @@ void MWMechanics::NpcStats::levelUp() // "When you gain a level, in addition to increasing three primary attributes, your Health // will automatically increase by 10% of your Endurance attribute. If you increased Endurance this level, // the Health increase is calculated from the increased Endurance" - mLevelHealthBonus += endurance * gmst.find("fLevelUpHealthEndMult")->getFloat(); - updateHealth(); + setHealth(getHealth().getBase() + endurance * gmst.find("fLevelUpHealthEndMult")->getFloat()); setLevel(getLevel()+1); } @@ -273,7 +271,7 @@ void MWMechanics::NpcStats::updateHealth() const int endurance = getAttribute(ESM::Attribute::Endurance).getBase(); const int strength = getAttribute(ESM::Attribute::Strength).getBase(); - setHealth(static_cast (0.5 * (strength + endurance)) + mLevelHealthBonus); + setHealth(static_cast (0.5 * (strength + endurance))); } int MWMechanics::NpcStats::getLevelupAttributeMultiplier(int attribute) const @@ -497,7 +495,6 @@ void MWMechanics::NpcStats::writeState (ESM::NpcStats& state) const state.mTimeToStartDrowning = mTimeToStartDrowning; state.mLastDrowningHit = mLastDrowningHit; - state.mLevelHealthBonus = mLevelHealthBonus; } void MWMechanics::NpcStats::readState (const ESM::NpcStats& state) @@ -549,5 +546,4 @@ void MWMechanics::NpcStats::readState (const ESM::NpcStats& state) mTimeToStartDrowning = state.mTimeToStartDrowning; mLastDrowningHit = state.mLastDrowningHit; - mLevelHealthBonus = state.mLevelHealthBonus; } diff --git a/apps/openmw/mwmechanics/npcstats.hpp b/apps/openmw/mwmechanics/npcstats.hpp index a066760d0..c78900287 100644 --- a/apps/openmw/mwmechanics/npcstats.hpp +++ b/apps/openmw/mwmechanics/npcstats.hpp @@ -52,8 +52,6 @@ namespace MWMechanics /// time since last hit from drowning float mLastDrowningHit; - float mLevelHealthBonus; - public: NpcStats(); @@ -104,7 +102,7 @@ namespace MWMechanics void updateHealth(); ///< Calculate health based on endurance and strength. - /// Called at character creation and at level up. + /// Called at character creation. void flagAsUsed (const std::string& id); diff --git a/components/esm/npcstats.cpp b/components/esm/npcstats.cpp index 26d8f9596..3e6aed99d 100644 --- a/components/esm/npcstats.cpp +++ b/components/esm/npcstats.cpp @@ -78,8 +78,9 @@ void ESM::NpcStats::load (ESMReader &esm) mLastDrowningHit = 0; esm.getHNOT (mLastDrowningHit, "DRLH"); - mLevelHealthBonus = 0; - esm.getHNOT (mLevelHealthBonus, "LVLH"); + // No longer used + float levelHealthBonus = 0; + esm.getHNOT (levelHealthBonus, "LVLH"); mCrimeId = -1; esm.getHNOT (mCrimeId, "CRID"); @@ -148,9 +149,6 @@ void ESM::NpcStats::save (ESMWriter &esm) const if (mLastDrowningHit) esm.writeHNT ("DRLH", mLastDrowningHit); - if (mLevelHealthBonus) - esm.writeHNT ("LVLH", mLevelHealthBonus); - if (mCrimeId != -1) esm.writeHNT ("CRID", mCrimeId); } diff --git a/components/esm/npcstats.hpp b/components/esm/npcstats.hpp index ce7c75d2a..0061fc05f 100644 --- a/components/esm/npcstats.hpp +++ b/components/esm/npcstats.hpp @@ -46,7 +46,6 @@ namespace ESM std::vector mUsedIds; float mTimeToStartDrowning; float mLastDrowningHit; - float mLevelHealthBonus; int mCrimeId; void load (ESMReader &esm);