mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 18:19:55 +00:00
Merge pull request #2326 from Capostrophic/regression
Fix zero division in enchantment magnitude calculation
This commit is contained in:
commit
d1152880c2
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;
|
||||
// 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…
Reference in a new issue