From 0c4fa55f1657d9f0d270051832484b76981dbaf4 Mon Sep 17 00:00:00 2001 From: Capostrophic <21265616+Capostrophic@users.noreply.github.com> Date: Tue, 19 Jun 2018 17:03:43 +0300 Subject: [PATCH 1/3] Make Open spells casted by anything trigger player crime event (fixes #4461) --- apps/openmw/mwmechanics/spellcasting.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index f6d92726d..0fa13fc07 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -665,8 +665,9 @@ namespace MWMechanics if (target.getCellRef().getLockLevel() > 0) { MWBase::Environment::get().getSoundManager()->playSound3D(target, "Open Lock", 1.f, 1.f); - if (!caster.isEmpty() && caster.getClass().isActor()) - MWBase::Environment::get().getMechanicsManager()->objectOpened(caster, target); + if (!caster.isEmpty()) + MWBase::Environment::get().getMechanicsManager()->objectOpened(getPlayer(), target); + // Use the player instead of the caster for vanilla crime compatibility if (caster == getPlayer()) MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicOpenSuccess}"); From 0731d79c091ab056c148ea5dbb17d5c97c17e7af Mon Sep 17 00:00:00 2001 From: Capostrophic <21265616+Capostrophic@users.noreply.github.com> Date: Tue, 19 Jun 2018 17:06:31 +0300 Subject: [PATCH 2/3] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc150f344..aa680a09e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ Bug #4457: Item without CanCarry flag prevents shield autoequipping in dark areas Bug #4458: AiWander console command handles idle chances incorrectly Bug #4459: NotCell dialogue condition doesn't support partial matches + Bug #4461: "Open" spell from non-player caster isn't a crime Feature #4256: Implement ToggleBorders (TB) console command Feature #3276: Editor: Search- Show number of (remaining) search results and indicate a search without any results Feature #4222: 360° screenshots From 6c23caadd7bf37bee5e80c5d0e1f8f323697144e Mon Sep 17 00:00:00 2001 From: Capostrophic <21265616+Capostrophic@users.noreply.github.com> Date: Tue, 19 Jun 2018 20:33:30 +0300 Subject: [PATCH 3/3] Fix crash when a target in a different cell is (un)locked --- apps/openmw/mwmechanics/spellcasting.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index 0fa13fc07..f1997e8d7 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -644,8 +644,9 @@ namespace MWMechanics { const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); const ESM::MagicEffect *magiceffect = store.get().find(effectId); - MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(target); - animation->addSpellCastGlow(magiceffect); + MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(target); + if (animation) + animation->addSpellCastGlow(magiceffect); if (target.getCellRef().getLockLevel() < magnitude) //If the door is not already locked to a higher value, lock it to spell magnitude { if (caster == getPlayer()) @@ -658,15 +659,16 @@ namespace MWMechanics { const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore(); const ESM::MagicEffect *magiceffect = store.get().find(effectId); - MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(target); - animation->addSpellCastGlow(magiceffect); + MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(target); + if (animation) + animation->addSpellCastGlow(magiceffect); if (target.getCellRef().getLockLevel() <= magnitude) { if (target.getCellRef().getLockLevel() > 0) { MWBase::Environment::get().getSoundManager()->playSound3D(target, "Open Lock", 1.f, 1.f); if (!caster.isEmpty()) - MWBase::Environment::get().getMechanicsManager()->objectOpened(getPlayer(), target); + MWBase::Environment::get().getMechanicsManager()->objectOpened(getPlayer(), target); // Use the player instead of the caster for vanilla crime compatibility if (caster == getPlayer())