From eccb49da18b6ddef273f08264775fcbe524186ca Mon Sep 17 00:00:00 2001 From: Andrei Kortunov Date: Thu, 11 Jan 2018 21:08:30 +0400 Subject: [PATCH] Do not summon the bound bow if there is no suitable ammo --- apps/openmw/mwmechanics/spellpriority.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/openmw/mwmechanics/spellpriority.cpp b/apps/openmw/mwmechanics/spellpriority.cpp index 3a730fbeb..7aef54007 100644 --- a/apps/openmw/mwmechanics/spellpriority.cpp +++ b/apps/openmw/mwmechanics/spellpriority.cpp @@ -1,4 +1,5 @@ #include "spellpriority.hpp" +#include "weaponpriority.hpp" #include #include @@ -335,6 +336,12 @@ namespace MWMechanics return 0.f; break; + case ESM::MagicEffect::BoundLongbow: + // AI should not summon the bow if there is no suitable ammo. + if (rateAmmo(actor, enemy, ESM::Weapon::Arrow) <= 0.f) + return 0.f; + break; + case ESM::MagicEffect::RestoreHealth: case ESM::MagicEffect::RestoreMagicka: case ESM::MagicEffect::RestoreFatigue: