From bd6d54cc8fdeafeaaa4328484aa978ef17f2d41b Mon Sep 17 00:00:00 2001 From: Torben Carrington Date: Mon, 27 May 2013 03:24:41 -0700 Subject: [PATCH] AIWander Minor Patch - Forgot an else statement and another check on an empty node vector, previously no nodes in range or only one would cause the AIWander to not do anything, now they will play idles correctly still. --- apps/openmw/mwmechanics/aiwander.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwmechanics/aiwander.cpp b/apps/openmw/mwmechanics/aiwander.cpp index 67f9cc112..4f7b69016 100644 --- a/apps/openmw/mwmechanics/aiwander.cpp +++ b/apps/openmw/mwmechanics/aiwander.cpp @@ -126,7 +126,11 @@ bool MWMechanics::AiWander::execute (const MWWorld::Ptr& actor) } mCurrentNode = mAllowedNodes[index]; mAllowedNodes.erase(mAllowedNodes.begin() + index); + if(mAllowedNodes.empty()) + mDistance = 0; } + else + mDistance = 0; } } @@ -203,7 +207,7 @@ bool MWMechanics::AiWander::execute (const MWWorld::Ptr& actor) } } - if(mMoveNow && mDistance && !mAllowedNodes.empty()) + if(mMoveNow && mDistance) { if(!mPathFinder.isPathConstructed()) {