mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-03 17:49:41 +00:00
Fix zero division in enchantment magnitude calculation
This commit is contained in:
parent
5b8fc5a151
commit
2c473d84ee
1 changed files with 2 additions and 1 deletions
|
@ -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…
Reference in a new issue