1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-27 03:35:27 +00:00

Avoid potential zero division

This commit is contained in:
Capostrophic 2018-09-01 01:24:13 +03:00
parent 58bd35c70d
commit 2965373ed6

View File

@ -52,7 +52,10 @@ namespace MWMechanics
{
static const float fAIMeleeWeaponMult = gmst.find("fAIMeleeWeaponMult")->mValue.getFloat();
static const float fAIRangeMeleeWeaponMult = gmst.find("fAIRangeMeleeWeaponMult")->mValue.getFloat();
rangedMult = fAIRangeMeleeWeaponMult / fAIMeleeWeaponMult;
if (fAIMeleeWeaponMult != 0)
rangedMult = fAIRangeMeleeWeaponMult / fAIMeleeWeaponMult;
else
rangedMult = fAIRangeMeleeWeaponMult;
}
}