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...
pull/210/head
scrawl 11 years ago
parent a9a7a7ec73
commit 2bfcec53bf

@ -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<ESM::Creature>()->mBase->mData.mSoul == 0))
if (!target.getClass().isNpc() // no messagebox for NPCs
&& (target.getTypeName() == typeid(ESM::Creature).name() && target.get<ESM::Creature>()->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:

Loading…
Cancel
Save