diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index 8c64d5f3f..5a55f25f5 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -1094,8 +1094,11 @@ void CharacterController::handleTextKey(const std::string &groupname, const std: // the same animation for all range types, so there are 3 "release" keys on the same time, one for each range type. && evt.compare(off, len, mAttackType + " release") == 0) { - MWBase::Environment::get().getWorld()->castSpell(mPtr, mCastingManualSpell); - mCastingManualSpell = false; + if (mPtr == getPlayer() || mwmp::Main::get().getCellController()->isLocalActor(mPtr)) + { + MWBase::Environment::get().getWorld()->castSpell(mPtr, mCastingManualSpell); + mCastingManualSpell = false; + } } else if (groupname == "shield" && evt.compare(off, len, "block hit") == 0) diff --git a/apps/openmw/mwmp/MechanicsHelper.cpp b/apps/openmw/mwmp/MechanicsHelper.cpp index 960c64df7..40ee080e9 100644 --- a/apps/openmw/mwmp/MechanicsHelper.cpp +++ b/apps/openmw/mwmp/MechanicsHelper.cpp @@ -273,6 +273,8 @@ void MechanicsHelper::processAttack(Attack attack, const MWWorld::Ptr& attacker) LOG_MESSAGE_SIMPLE(TimedLog::LOG_VERBOSE, "Processing attack from %s of type %i", attacker.getClass().getName(attacker).c_str(), attack.type); + LOG_APPEND(TimedLog::LOG_VERBOSE, "- pressed: %s", attack.pressed ? "true" : "false"); + if (!attack.pressed) { LOG_APPEND(TimedLog::LOG_VERBOSE, "- success: %s", attack.success ? "true" : "false"); @@ -281,8 +283,6 @@ void MechanicsHelper::processAttack(Attack attack, const MWWorld::Ptr& attacker) LOG_APPEND(TimedLog::LOG_VERBOSE, "- damage: %f", attack.damage); } - LOG_APPEND(TimedLog::LOG_VERBOSE, "- pressed: %s", attack.pressed ? "true" : "false"); - MWMechanics::CreatureStats &attackerStats = attacker.getClass().getCreatureStats(attacker); MWWorld::Ptr victim; @@ -422,13 +422,13 @@ void MechanicsHelper::processCast(Cast cast, const MWWorld::Ptr& caster) LOG_MESSAGE_SIMPLE(TimedLog::LOG_VERBOSE, "Processing cast from %s of type %i", caster.getClass().getName(caster).c_str(), cast.type); + LOG_APPEND(TimedLog::LOG_VERBOSE, "- pressed: %s", cast.pressed ? "true" : "false"); + if (!cast.pressed) { LOG_APPEND(TimedLog::LOG_VERBOSE, "- success: %s", cast.success ? "true" : "false"); } - LOG_APPEND(TimedLog::LOG_VERBOSE, "- pressed: %s", cast.pressed ? "true" : "false"); - MWMechanics::CreatureStats &casterStats = caster.getClass().getCreatureStats(caster); MWWorld::Ptr victim; @@ -452,11 +452,8 @@ void MechanicsHelper::processCast(Cast cast, const MWWorld::Ptr& caster) { casterStats.getSpells().setSelectedSpell(cast.spellId); - if (cast.instant) - { + if (cast.success) MWBase::Environment::get().getWorld()->castSpell(caster); - cast.instant = false; - } LOG_APPEND(TimedLog::LOG_VERBOSE, "- spellId: %s", cast.spellId.c_str()); }