Break invisibility before applying CE enchantments

check_span
Evil Eye 2 years ago
parent a62b16df5d
commit 6196e777da

@ -144,6 +144,7 @@
Bug #6901: Morrowind.exe soul gem usage discrepancy
Bug #6909: Using enchanted items has no animation
Bug #6910: Torches should not be extinguished when not being held
Bug #6913: Constant effect enchanted items don't break invisibility
Feature #890: OpenMW-CS: Column filtering
Feature #1465: "Reset" argument for AI functions
Feature #2491: Ability to make OpenMW "portable"

@ -219,6 +219,9 @@ namespace MWMechanics
return params.mSlot == slotIndex && params.mType == ESM::ActiveSpells::Type_Enchantment && params.mId == slot->getCellRef().getRefId();
}) != mSpells.end())
continue;
// world->breakInvisibility leads to a stack overflow as it calls this method so just break invisibility manually
purgeEffect(ptr, ESM::MagicEffect::Invisibility);
applyPurges(ptr);
const ActiveSpellParams& params = mSpells.emplace_back(ActiveSpellParams{*slot, enchantment, slotIndex, ptr});
for(const auto& effect : params.mEffects)
MWMechanics::playEffects(ptr, *world->getStore().get<ESM::MagicEffect>().find(effect.mEffectId), playNonLooping);

Loading…
Cancel
Save