1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-29 00:32:49 +00:00

Merge branch 'oopsy' into 'master'

Expect recent saves to store the modified value

Closes #6604

See merge request OpenMW/openmw!1649
This commit is contained in:
Alexei Kotov 2022-02-12 14:24:51 +00:00
commit c1cd3ba9a1
2 changed files with 4 additions and 4 deletions

View File

@ -21,13 +21,13 @@ namespace MWMechanics
void Stat<T>::writeState (ESM::StatState<T>& state) const
{
state.mBase = mBase;
state.mMod = mModifier;
state.mMod = mModifier + mBase;
}
template<typename T>
void Stat<T>::readState (const ESM::StatState<T>& state)
{
mBase = state.mBase;
mModifier = state.mMod;
mModifier = state.mMod - mBase;
}

View File

@ -201,10 +201,10 @@ namespace MWWorld
{
auto& dynamic = creatureStats.mDynamic[i];
dynamic.mCurrent -= dynamic.mMod - dynamic.mBase;
dynamic.mMod = 0.f;
dynamic.mMod = dynamic.mBase;
}
for(std::size_t i = 0; i < 4; ++i)
creatureStats.mAiSettings[i].mMod = 0.f;
creatureStats.mAiSettings[i].mMod = creatureStats.mAiSettings[i].mBase;
if(npcStats)
{
for(std::size_t i = 0; i < ESM::Skill::Length; ++i)