mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-03 17:15:35 +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,14 +157,18 @@ namespace MWClass
|
|||
|
||||
float iWeight = gmst.find (typeGmst)->getInt();
|
||||
|
||||
if (iWeight * gmst.find ("fLightMaxMod")->getFloat()>=
|
||||
ref->mBase->mData.mWeight)
|
||||
float epsilon = 5e-4;
|
||||
|
||||
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;
|
||||
|
||||
if (iWeight * gmst.find ("fMedMaxMod")->getFloat()>=
|
||||
ref->mBase->mData.mWeight)
|
||||
if (ref->mBase->mData.mWeight <= iWeight * gmst.find ("fMedMaxMod")->getFloat() + epsilon)
|
||||
return ESM::Skill::MediumArmor;
|
||||
|
||||
else
|
||||
return ESM::Skill::HeavyArmor;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue