From 67450a70460e0602d1fe7a49ea9b72d132e0b895 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Fri, 25 Jan 2019 15:09:22 +0300 Subject: [PATCH] Don't apply effects when spell absorption is successful (bug #4820) --- CHANGELOG.md | 1 + apps/openmw/mwmechanics/spellcasting.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31e086842..6b92ab79c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ Bug #4800: Standing collisions are not updated immediately when an object is teleported without a cell change Bug #4803: Stray special characters before begin statement break script compilation Bug #4804: Particle system with the "Has Sizes = false" causes an exception + Bug #4820: Spell absorption is broken Feature #2229: Improve pathfinding AI Feature #3442: Default values for fallbacks from ini file Feature #3610: Option to invert X axis diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index 58d5a85a0..9f272e1f3 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -501,8 +501,11 @@ namespace MWMechanics float magnitudeMult = 1; - if (!absorbed && target.getClass().isActor()) + if (target.getClass().isActor()) { + if (absorbed) + continue; + bool isHarmful = magicEffect->mData.mFlags & ESM::MagicEffect::Harmful; // Reflect harmful effects if (isHarmful && !reflected && !caster.isEmpty() && caster != target && !(magicEffect->mData.mFlags & ESM::MagicEffect::Unreflectable))