diff --git a/apps/openmw/mwmechanics/spellcasting.cpp b/apps/openmw/mwmechanics/spellcasting.cpp index c54601eec..a3a3b030a 100644 --- a/apps/openmw/mwmechanics/spellcasting.cpp +++ b/apps/openmw/mwmechanics/spellcasting.cpp @@ -1057,7 +1057,7 @@ namespace MWMechanics Start of tes3mp change (major) Make spell casting fail based on the attack success rated determined - in LocalPlayer and LocalActor's updateAttack() + in LocalPlayer and LocalActor's updateAttackOrCast() */ mwmp::Cast *localCast = NULL; mwmp::Cast *dedicatedCast = MechanicsHelper::getDedicatedCast(mCaster); @@ -1065,7 +1065,10 @@ namespace MWMechanics if (dedicatedCast) dedicatedCast->pressed = false; else + { localCast = MechanicsHelper::getLocalCast(mCaster); + localCast->success = MechanicsHelper::getSpellSuccess(mId, mCaster); + } // Check success if ((localCast && localCast->success == false) || diff --git a/apps/openmw/mwmp/LocalActor.cpp b/apps/openmw/mwmp/LocalActor.cpp index adb532ea1..61133bd8f 100644 --- a/apps/openmw/mwmp/LocalActor.cpp +++ b/apps/openmw/mwmp/LocalActor.cpp @@ -265,15 +265,6 @@ void LocalActor::updateAttackOrCast() } else if (cast.shouldSend) { - if (cast.type == Cast::REGULAR) - { - MWMechanics::CreatureStats &casterStats = ptr.getClass().getCreatureStats(ptr); - cast.spellId = casterStats.getSpells().getSelectedSpell(); - - if (cast.pressed) - cast.success = MechanicsHelper::getSpellSuccess(cast.spellId, ptr); - } - mwmp::Main::get().getNetworking()->getActorList()->addCastActor(*this); cast.shouldSend = false; } diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index ac15653c6..05fec23a8 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -609,14 +609,6 @@ void LocalPlayer::updateAttackOrCast() } else if (cast.shouldSend) { - if (cast.type == Cast::REGULAR) - { - cast.spellId = MWBase::Environment::get().getWindowManager()->getSelectedSpell(); - - if (cast.pressed) - cast.success = MechanicsHelper::getSpellSuccess(cast.spellId, getPlayerPtr()); - } - getNetworking()->getPlayerPacket(ID_PLAYER_CAST)->setPlayer(this); getNetworking()->getPlayerPacket(ID_PLAYER_CAST)->Send();