diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index 060db70f9..deb24dbdc 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -938,25 +938,6 @@ namespace MWMechanics else if (isProjectile || !mTarget.isEmpty()) inflict(mTarget, mCaster, enchantment->mEffects, ESM::RT_Target); - /* - Start of tes3mp addition - - If this mCaster belongs to a LocalPlayer or LocalActor, get their Attack and prepare - it for sending - */ - mwmp::Attack *localAttack = MechanicsHelper::getLocalAttack(mCaster); - - if (localAttack) - { - MechanicsHelper::resetAttack(localAttack); - localAttack->type = mwmp::Attack::ITEM_MAGIC; - localAttack->itemId = item.getCellRef().getRefId(); - localAttack->shouldSend = true; - } - /* - End of tes3mp addition - */ - return true; } diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 2b7830a4e..0f0e16a6b 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -19,6 +19,7 @@ #include "../mwmp/DedicatedActor.hpp" #include "../mwmp/ObjectList.hpp" #include "../mwmp/CellController.hpp" +#include "../mwmp/MechanicsHelper.hpp" /* End of tes3mp addition */ @@ -3260,7 +3261,28 @@ namespace MWWorld { MWWorld::InventoryStore& inv = actor.getClass().getInventoryStore(actor); if (inv.getSelectedEnchantItem() != inv.end()) + /* + Start of tes3mp change (minor) + + If this actor is a LocalPlayer or LocalActor, get their Attack and prepare + it for sending + */ + { cast.cast(*inv.getSelectedEnchantItem()); + + mwmp::Attack *localAttack = MechanicsHelper::getLocalAttack(actor); + + if (localAttack) + { + MechanicsHelper::resetAttack(localAttack); + localAttack->type = mwmp::Attack::ITEM_MAGIC; + localAttack->itemId = inv.getSelectedEnchantItem()->getCellRef().getRefId(); + localAttack->shouldSend = true; + } + } + /* + End of tes3mp addition + */ } }