1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-16 20:19:57 +00:00

Merge pull request #2326 from Capostrophic/regression

Fix zero division in enchantment magnitude calculation
This commit is contained in:
Andrei Kortunov 2019-04-14 15:09:18 +04:00 committed by GitHub
commit d1152880c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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