1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-15 20:49:56 +00:00
openmw-tes3mp/apps/openmw/mwmechanics/stat.cpp
dteviot 41e15e0c2d Limit maximum attribute damage (Fixes #2367)
Maximum damage that an attribute can have = base + fortify.
2015-03-01 10:27:51 +13:00

34 lines
No EOL
818 B
C++

#include "stat.hpp"
void MWMechanics::AttributeValue::writeState (ESM::StatState<int>& state) const
{
state.mBase = mBase;
state.mMod = mModifier;
state.mDamage = mDamage;
}
void MWMechanics::AttributeValue::readState (const ESM::StatState<int>& state)
{
mBase = state.mBase;
mModifier = state.mMod;
mDamage = state.mDamage;
}
void MWMechanics::AttributeValue::setModifiers(int fortify, int drain, int absorb)
{
mFortified = fortify;
mModifier = (fortify - drain) - absorb;
}
void MWMechanics::SkillValue::writeState (ESM::StatState<int>& state) const
{
AttributeValue::writeState (state);
state.mProgress = mProgress;
}
void MWMechanics::SkillValue::readState (const ESM::StatState<int>& state)
{
AttributeValue::readState (state);
mProgress = state.mProgress;
}