From 256439f884a34bec5dd63823d340ea8002a2364f Mon Sep 17 00:00:00 2001 From: Daniel Pettersson Date: Thu, 9 Jun 2016 21:23:36 +0200 Subject: [PATCH] Added 1.5 bonus for ranged weapons when weapons are rated --- apps/openmw/mwmechanics/aicombataction.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/aicombataction.cpp b/apps/openmw/mwmechanics/aicombataction.cpp index cee2aae9c..f62c34fc8 100644 --- a/apps/openmw/mwmechanics/aicombataction.cpp +++ b/apps/openmw/mwmechanics/aicombataction.cpp @@ -109,6 +109,10 @@ namespace MWMechanics return 0.f; float rating=0.f; + float bonus=0.f; + + if (weapon->mData.mType >= ESM::Weapon::MarksmanBow && weapon->mData.mType <= ESM::Weapon::MarksmanThrown) + bonus+=1.5f; if (weapon->mData.mType >= ESM::Weapon::MarksmanBow) { @@ -160,7 +164,7 @@ namespace MWMechanics if (skill != -1) rating *= actor.getClass().getSkill(actor, skill) / 100.f; - return rating; + return rating + bonus; } float rateSpell(const ESM::Spell *spell, const MWWorld::Ptr &actor, const MWWorld::Ptr& enemy)