From c10585fb07f96e7b597e1ab45eb6ad332f6febb1 Mon Sep 17 00:00:00 2001 From: Allofich Date: Wed, 11 Jan 2017 22:09:26 +0900 Subject: [PATCH 1/2] Match best attack selection to original MW (Fixes #3721) --- apps/openmw/mwmechanics/character.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwmechanics/character.cpp b/apps/openmw/mwmechanics/character.cpp index c771d9fcc..297cb0804 100644 --- a/apps/openmw/mwmechanics/character.cpp +++ b/apps/openmw/mwmechanics/character.cpp @@ -70,12 +70,14 @@ std::string getBestAttack (const ESM::Weapon* weapon) int slash = (weapon->mData.mSlash[0] + weapon->mData.mSlash[1])/2; int chop = (weapon->mData.mChop[0] + weapon->mData.mChop[1])/2; int thrust = (weapon->mData.mThrust[0] + weapon->mData.mThrust[1])/2; - if (slash >= chop && slash >= thrust) + if (slash == chop && slash == thrust) return "slash"; - else if (chop >= slash && chop >= thrust) - return "chop"; - else + else if (thrust >= chop && thrust >= slash) return "thrust"; + else if (slash >= chop && slash >= thrust) + return "slash"; + else + return "chop"; } // Converts a movement Run state to its equivalent Walk state. From 2322ab3125f5e238b18f0cbfd05c2e3767c9e2e7 Mon Sep 17 00:00:00 2001 From: Allofich Date: Thu, 12 Jan 2017 00:07:22 +0900 Subject: [PATCH 2/2] Don't make Command spells cancel AI packages (Fixes #3649) --- apps/openmw/mwmechanics/aifollow.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/openmw/mwmechanics/aifollow.hpp b/apps/openmw/mwmechanics/aifollow.hpp index e46205b95..051a4a2ce 100644 --- a/apps/openmw/mwmechanics/aifollow.hpp +++ b/apps/openmw/mwmechanics/aifollow.hpp @@ -37,6 +37,7 @@ namespace MWMechanics MWWorld::Ptr getTarget() const; virtual bool sideWithTarget() const { return true; } virtual bool followTargetThroughDoors() const { return true; } + virtual bool shouldCancelPreviousAi() const { return !mCommanded; } virtual AiFollow *clone() const;