From 2813aaa4673932b22024ebf05c571a8339dbefee Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Tue, 8 May 2012 17:49:39 -0400 Subject: [PATCH] Fix stupid in plAvBrainCritter::GoToGoal Changing the next behavior to running on every goal update causes the quabs to skitter about one inch every five seconds. Obviously, we do not need to start running if we are already running, so let's check that. --- .../Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp index 5ebd4df6..05f7dd99 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp @@ -317,9 +317,13 @@ std::string plAvBrainCritter::RunBehaviorName() const void plAvBrainCritter::GoToGoal(hsPoint3 newGoal, bool avoidingAvatars /* = false */) { fFinalGoalPos = newGoal; - fAvoidingAvatars = avoidingAvatars; - fNextMode = IPickBehavior(kRun); - // TODO: Pathfinding here! + fAvoidingAvatars = avoidingAvatars; // TODO: make this do something? + + // Only play the run behavior if it's not already activated + // Why? This might just be an update to a preexisting goal. + if(!RunningBehavior(RunBehaviorName())) + fNextMode = IPickBehavior(kRun); + // Missing TODO Turd: Pathfinding. } bool plAvBrainCritter::AtGoal() const