1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-12 13:13:27 +00:00

Allow GetEffect to detect 0 magnitude spells

This commit is contained in:
Evil Eye 2024-08-03 11:27:54 +02:00
parent 5d57ad7e85
commit fe50b1a22b
2 changed files with 8 additions and 7 deletions

View File

@ -188,6 +188,7 @@
Bug #8063: menu_background.bik video with audio freezes the game forever 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 #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 #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 #1415: Infinite fall failsafe
Feature #2566: Handle NAM9 records for manual cell references Feature #2566: Handle NAM9 records for manual cell references
Feature #3501: OpenMW-CS: Instance Editing - Shortcuts for axial locking Feature #3501: OpenMW-CS: Instance Editing - Shortcuts for axial locking

View File

@ -603,17 +603,17 @@ namespace MWScript
key = ESM::MagicEffect::effectGmstIdToIndex(effect); key = ESM::MagicEffect::effectGmstIdToIndex(effect);
const MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats(ptr); const MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats(ptr);
for (const auto& spell : stats.getActiveSpells())
const MWMechanics::MagicEffects& effects = stats.getMagicEffects();
for (const auto& activeEffect : effects)
{ {
if (activeEffect.first.mId == key && activeEffect.second.getModifier() > 0) for (const auto& effect : spell.getEffects())
{
if (effect.mFlags & ESM::ActiveEffect::Flag_Applied && effect.mEffectId == key)
{ {
runtime.push(1); runtime.push(1);
return; return;
} }
} }
}
runtime.push(0); runtime.push(0);
} }
}; };