mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-03 19:45:34 +00:00
Add epsilon to armor class calculation
This commit is contained in:
parent
261e755e73
commit
0f1451babd
1 changed files with 9 additions and 5 deletions
|
@ -157,15 +157,19 @@ namespace MWClass
|
||||||
|
|
||||||
float iWeight = gmst.find (typeGmst)->getInt();
|
float iWeight = gmst.find (typeGmst)->getInt();
|
||||||
|
|
||||||
if (iWeight * gmst.find ("fLightMaxMod")->getFloat()>=
|
float epsilon = 5e-4;
|
||||||
ref->mBase->mData.mWeight)
|
|
||||||
|
if (ref->mBase->mData.mWeight == 0)
|
||||||
|
return ESM::Skill::Unarmored;
|
||||||
|
|
||||||
|
if (ref->mBase->mData.mWeight <= iWeight * gmst.find ("fLightMaxMod")->getFloat() + epsilon)
|
||||||
return ESM::Skill::LightArmor;
|
return ESM::Skill::LightArmor;
|
||||||
|
|
||||||
if (iWeight * gmst.find ("fMedMaxMod")->getFloat()>=
|
if (ref->mBase->mData.mWeight <= iWeight * gmst.find ("fMedMaxMod")->getFloat() + epsilon)
|
||||||
ref->mBase->mData.mWeight)
|
|
||||||
return ESM::Skill::MediumArmor;
|
return ESM::Skill::MediumArmor;
|
||||||
|
|
||||||
return ESM::Skill::HeavyArmor;
|
else
|
||||||
|
return ESM::Skill::HeavyArmor;
|
||||||
}
|
}
|
||||||
|
|
||||||
int Armor::getValue (const MWWorld::Ptr& ptr) const
|
int Armor::getValue (const MWWorld::Ptr& ptr) const
|
||||||
|
|
Loading…
Reference in a new issue