1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-25 12:41:01 +00:00

Merge branch 'breaklilacor' into 'master'

Allow GetEffect to detect 0 magnitude spells

Closes #8097

See merge request OpenMW/openmw!4297
This commit is contained in:
psi29a 2024-08-11 09:06:32 +00:00
commit 9234b5707f
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 #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

View File

@ -603,17 +603,17 @@ 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())
{
if (effect.mFlags & ESM::ActiveEffect::Flag_Applied && effect.mEffectId == key)
{
runtime.push(1);
return;
}
}
}
runtime.push(0);
}
};