Merge pull request #2326 from Capostrophic/regression

Fix zero division in enchantment magnitude calculation
pull/2327/head
Andrei Kortunov 6 years ago committed by GitHub
commit d1152880c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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);

Loading…
Cancel
Save