mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-01 20:15:33 +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();
|
||||
|
||||
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;
|
||||
|
||||
return ESM::Skill::HeavyArmor;
|
||||
else
|
||||
return ESM::Skill::HeavyArmor;
|
||||
}
|
||||
|
||||
int Armor::getValue (const MWWorld::Ptr& ptr) const
|
||||
|
|
Loading…
Reference in a new issue