1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-03 17:19:39 +00:00

Fix zero division in enchantment magnitude calculation

This commit is contained in:
Capostrophic 2019-04-14 12:47:11 +03:00
parent 5b8fc5a151
commit 2c473d84ee

View file

@ -644,6 +644,7 @@ void MWWorld::InventoryStore::updateMagicEffects(const Ptr& actor)
{
int delta = effect.mMagnMax - effect.mMagnMin;
// Roll some dice, one for each effect
if (delta)
params[i].mRandom = Misc::Rng::rollDice(delta + 1) / static_cast<float>(delta);
// Try resisting each effect
params[i].mMultiplier = MWMechanics::getEffectMultiplier(effect.mEffectID, actor, actor);