From 66307dd8894c95176eedfc5757642c6a14c2c88d Mon Sep 17 00:00:00 2001 From: mrcheko Date: Sun, 18 May 2014 16:10:14 +0400 Subject: [PATCH] travis fix #3 :( --- apps/openmw/mwmechanics/aisequence.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/openmw/mwmechanics/aisequence.cpp b/apps/openmw/mwmechanics/aisequence.cpp index 2da213529..f0f6bffc1 100644 --- a/apps/openmw/mwmechanics/aisequence.cpp +++ b/apps/openmw/mwmechanics/aisequence.cpp @@ -133,14 +133,14 @@ void AiSequence::execute (const MWWorld::Ptr& actor,float duration) // if active package is combat one, choose nearest target if (mLastAiPackage == AiPackage::TypeIdCombat) { - std::list::const_iterator itActualCombat; + std::list::iterator itActualCombat; float nearestDist = std::numeric_limits::max(); Ogre::Vector3 vActorPos = Ogre::Vector3(actor.getRefData().getPosition().pos); const AiCombat *package; - for(std::list::const_iterator it = mPackages.begin(); it != mPackages.end(); ++it) + for(std::list::iterator it = mPackages.begin(); it != mPackages.end(); ++it) { package = static_cast(*it); @@ -159,9 +159,7 @@ void AiSequence::execute (const MWWorld::Ptr& actor,float duration) if (mPackages.begin() != itActualCombat) { // move combat package with nearest target to the front - AiPackage *package = (*itActualCombat)->clone(); - mPackages.erase(itActualCombat); - mPackages.push_front(package); + mPackages.splice(mPackages.begin(), mPackages, itActualCombat); } }