mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-26 09:35:28 +00:00
Merge pull request #2326 from Capostrophic/regression
Fix zero division in enchantment magnitude calculation
This commit is contained in:
commit
d1152880c2
@ -644,7 +644,8 @@ void MWWorld::InventoryStore::updateMagicEffects(const Ptr& actor)
|
||||
{
|
||||
int delta = effect.mMagnMax - effect.mMagnMin;
|
||||
// Roll some dice, one for each effect
|
||||
params[i].mRandom = Misc::Rng::rollDice(delta + 1) / static_cast<float>(delta);
|
||||
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);
|
||||
++i;
|
||||
|
Loading…
x
Reference in New Issue
Block a user