From b7a92431733f729f89196713a9b19fdbd22138d1 Mon Sep 17 00:00:00 2001 From: gus Date: Mon, 28 Oct 2013 18:22:36 +0100 Subject: [PATCH] fighting should stop when the target is dead --- apps/openmw/mwmechanics/aicombat.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwmechanics/aicombat.cpp b/apps/openmw/mwmechanics/aicombat.cpp index b01889f89b..80ad241ef8 100644 --- a/apps/openmw/mwmechanics/aicombat.cpp +++ b/apps/openmw/mwmechanics/aicombat.cpp @@ -33,6 +33,8 @@ namespace MWMechanics { const MWWorld::Ptr target = MWBase::Environment::get().getWorld()->getPtr(mTargetId, false); + if(MWWorld::Class::get(actor).getCreatureStats(actor).getHealth().getCurrent() <= 0) return true; + if(actor.getTypeName() == typeid(ESM::NPC).name()) { MWWorld::Class::get(actor).setStance(actor, MWWorld::Class::Run,true); @@ -45,8 +47,6 @@ namespace MWMechanics const ESM::Pathgrid *pathgrid = MWBase::Environment::get().getWorld()->getStore().get().search(*actor.getCell()->mCell); - int cellX = actor.getCell()->mCell->mData.mX; - int cellY = actor.getCell()->mCell->mData.mY; float xCell = 0; float yCell = 0;