From 2e623bac5a6c778f947ec4c66db8cb56c9f06f06 Mon Sep 17 00:00:00 2001 From: scrawl Date: Thu, 28 Aug 2014 02:01:41 +0200 Subject: [PATCH] Don't attempt to use broken weapons in AI --- apps/openmw/mwmechanics/aicombataction.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/openmw/mwmechanics/aicombataction.cpp b/apps/openmw/mwmechanics/aicombataction.cpp index 528bd6d6c7..c10c982b85 100644 --- a/apps/openmw/mwmechanics/aicombataction.cpp +++ b/apps/openmw/mwmechanics/aicombataction.cpp @@ -102,7 +102,11 @@ namespace MWMechanics } if (item.getClass().hasItemHealth(item)) + { + if (item.getClass().getItemHealth(item) == 0) + return 0.f; rating *= item.getClass().getItemHealth(item) / float(item.getClass().getItemMaxHealth(item)); + } if (weapon->mData.mType == ESM::Weapon::MarksmanBow) {