diff --git a/CHANGELOG.md b/CHANGELOG.md index c2b423d70b..3625b8fcc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -188,6 +188,7 @@ Bug #8063: menu_background.bik video with audio freezes the game forever Bug #8064: Lua move360 script doesn't respect the enableZoom/disableZoom Camera interface setting Bug #8085: Don't search in scripts or shaders directories for "Select directories you wish to add" menu in launcher + Bug #8097: GetEffect doesn't detect 0 magnitude spells Feature #1415: Infinite fall failsafe Feature #2566: Handle NAM9 records for manual cell references Feature #3501: OpenMW-CS: Instance Editing - Shortcuts for axial locking diff --git a/apps/openmw/mwscript/miscextensions.cpp b/apps/openmw/mwscript/miscextensions.cpp index dff07b78fa..7fb901f31b 100644 --- a/apps/openmw/mwscript/miscextensions.cpp +++ b/apps/openmw/mwscript/miscextensions.cpp @@ -603,15 +603,15 @@ namespace MWScript key = ESM::MagicEffect::effectGmstIdToIndex(effect); const MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats(ptr); - - const MWMechanics::MagicEffects& effects = stats.getMagicEffects(); - - for (const auto& activeEffect : effects) + for (const auto& spell : stats.getActiveSpells()) { - if (activeEffect.first.mId == key && activeEffect.second.getModifier() > 0) + for (const auto& effect : spell.getEffects()) { - runtime.push(1); - return; + if (effect.mFlags & ESM::ActiveEffect::Flag_Applied && effect.mEffectId == key) + { + runtime.push(1); + return; + } } } runtime.push(0);