mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-10 15:45:37 +00:00
Fix zero division in enchantment magnitude calculation
This commit is contained in:
parent
5b8fc5a151
commit
2c473d84ee
@ -644,7 +644,8 @@ void MWWorld::InventoryStore::updateMagicEffects(const Ptr& actor)
|
|||||||
{
|
{
|
||||||
int delta = effect.mMagnMax - effect.mMagnMin;
|
int delta = effect.mMagnMax - effect.mMagnMin;
|
||||||
// Roll some dice, one for each effect
|
// 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
|
// Try resisting each effect
|
||||||
params[i].mMultiplier = MWMechanics::getEffectMultiplier(effect.mEffectID, actor, actor);
|
params[i].mMultiplier = MWMechanics::getEffectMultiplier(effect.mEffectID, actor, actor);
|
||||||
++i;
|
++i;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user