From 2bfcec53bf2fe38dc182841d308dbef4e82a4b8b Mon Sep 17 00:00:00 2001 From: scrawl Date: Wed, 6 Aug 2014 02:46:56 +0200 Subject: [PATCH] Don't show sMagicInvalidTarget for soultrap on NPCs (Fixes #1762) Note the message was accurate, since NPCs can't be soultrapped. Maybe vanilla doesn't show it to not spam the screen with message boxes when attacking with a "soultrap on strike" weapon... --- apps/openmw/mwmechanics/spellcasting.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index 025777d09..f53aceaef 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -252,12 +252,12 @@ namespace MWMechanics } break; case ESM::MagicEffect::Soultrap: - if ((target.getClass().isActor() && target.getClass().isNpc()) - || (target.getTypeName() == typeid(ESM::Creature).name() && target.get()->mBase->mData.mSoul == 0)) + if (!target.getClass().isNpc() // no messagebox for NPCs + && (target.getTypeName() == typeid(ESM::Creature).name() && target.get()->mBase->mData.mSoul == 0)) { if (castByPlayer) MWBase::Environment::get().getWindowManager()->messageBox("#{sMagicInvalidTarget}"); - return false; + return true; // must still apply to get visual effect and have target regard it as attack } break; case ESM::MagicEffect::AlmsiviIntervention: