From 81e2e48561945209c51c03c0f44e571fb80988e4 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Mon, 31 Dec 2018 13:24:32 +0200 Subject: [PATCH] [Client] Fix item magic casting synchronization for spell scrolls Previously, spell scrolls were used up before their IDs could be included in attacks packets supposed to be sent for them. --- apps/openmw/mwworld/worldimp.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwworld/worldimp.cpp b/apps/openmw/mwworld/worldimp.cpp index 1272fe3af..c4ad67d53 100644 --- a/apps/openmw/mwworld/worldimp.cpp +++ b/apps/openmw/mwworld/worldimp.cpp @@ -3258,10 +3258,11 @@ namespace MWWorld If this actor is a LocalPlayer or LocalActor, get their Attack and prepare it for sending + + Set the attack details before going through with the casting, in case it's + a one use item that would get removed through the casting (like a scroll) */ { - cast.cast(*inv.getSelectedEnchantItem()); - mwmp::Attack *localAttack = MechanicsHelper::getLocalAttack(actor); if (localAttack) @@ -3271,6 +3272,8 @@ namespace MWWorld localAttack->itemId = inv.getSelectedEnchantItem()->getCellRef().getRefId(); localAttack->shouldSend = true; } + + cast.cast(*inv.getSelectedEnchantItem()); } /* End of tes3mp addition