From ea7e0abdc23b778b43e917e3f590792bdbb7b91d Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 26 Jan 2014 22:07:20 +0100 Subject: [PATCH] Move WhenStrikes skill success to a more appropriate place --- apps/openmw/mwclass/npc.cpp | 5 +---- apps/openmw/mwmechanics/spellcasting.cpp | 3 +++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwclass/npc.cpp b/apps/openmw/mwclass/npc.cpp index 9e54f2856..512a5279c 100644 --- a/apps/openmw/mwclass/npc.cpp +++ b/apps/openmw/mwclass/npc.cpp @@ -603,10 +603,7 @@ namespace MWClass { MWMechanics::CastSpell cast(ptr, victim); cast.mHitPosition = hitPosition; - bool success = cast.cast(weapon); - - if (ptr.getRefData().getHandle() == "player" && success) - skillUsageSucceeded (ptr, ESM::Skill::Enchant, 3); + cast.cast(weapon); } } diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index 749a5d7b1..0dec49f13 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -554,7 +554,10 @@ namespace MWMechanics else if (enchantment->mData.mType != ESM::Enchantment::WhenStrikes) { if (mCaster.getRefData().getHandle() == "player") + { MWBase::Environment::get().getWindowManager()->setSelectedEnchantItem(item); // Set again to show the modified charge + mCaster.getClass().skillUsageSucceeded (mCaster, ESM::Skill::Enchant, 3); + } } inflict(mCaster, mCaster, enchantment->mEffects, ESM::RT_Self);