From 3b50bcfb3a668db7529596370b49bf8d85771e71 Mon Sep 17 00:00:00 2001 From: Evil Eye <malusluminis@hotmail.com> Date: Sun, 19 Jan 2025 20:07:53 +0100 Subject: [PATCH] Allow GetSpellEffects to detect enchantments by id --- apps/openmw/mwscript/miscextensions.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwscript/miscextensions.cpp b/apps/openmw/mwscript/miscextensions.cpp index ed2ef756e6..95238d4299 100644 --- a/apps/openmw/mwscript/miscextensions.cpp +++ b/apps/openmw/mwscript/miscextensions.cpp @@ -884,8 +884,8 @@ namespace MWScript return; } - const MWMechanics::CreatureStats& stats = ptr.getClass().getCreatureStats(ptr); - runtime.push(stats.getActiveSpells().isSpellActive(id)); + const auto& activeSpells = ptr.getClass().getCreatureStats(ptr).getActiveSpells(); + runtime.push(activeSpells.isSpellActive(id) || activeSpells.isEnchantmentActive(id)); } };