diff --git a/apps/openmw/mwmechanics/aisequence.cpp b/apps/openmw/mwmechanics/aisequence.cpp index d55ba13dd8..9a42168d63 100644 --- a/apps/openmw/mwmechanics/aisequence.cpp +++ b/apps/openmw/mwmechanics/aisequence.cpp @@ -125,16 +125,16 @@ bool AiSequence::isInCombat() const bool AiSequence::isEngagedWithActor() const { - bool isFightingNpc = false; for (std::list::const_iterator it = mPackages.begin(); it != mPackages.end(); ++it) { if ((*it)->getTypeId() == AiPackage::TypeIdCombat) { MWWorld::Ptr target2 = (*it)->getTarget(); if (!target2.isEmpty() && target2.getClass().isNpc()) - isFightingNpc = true; + return true; } } + return false; } bool AiSequence::hasPackage(int typeId) const