diff --git a/indra/llcharacter/llmotioncontroller.cpp b/indra/llcharacter/llmotioncontroller.cpp
index ea0c586c8d18e548bece8581411c9a56b133ecff..11c2336805f93df166c377b05aa51fab626e041c 100644
--- a/indra/llcharacter/llmotioncontroller.cpp
+++ b/indra/llcharacter/llmotioncontroller.cpp
@@ -333,7 +333,7 @@ void LLMotionController::removeMotionInstance(LLMotion* motionp)
 			motionp->deactivate();
 		mLoadingMotions.erase(motionp);
 		mLoadedMotions.erase(motionp);
-		mActiveMotions.erase(motionp);
+		mActiveMotions.remove(motionp);
 		delete motionp;
 	}
 }
@@ -961,9 +961,9 @@ BOOL LLMotionController::activateMotionInstance(LLMotion *motion, F32 time)
 	
 	if (motion->isActive())
 	{
-		mActiveMotions.erase(motion);
+		mActiveMotions.remove(motion);
 	}
-	mActiveMotions.emplace(motion);
+	mActiveMotions.push_front(motion);
 
 	motion->activate(time);
 	motion->onUpdate(0.f, mJointSignature[1]);
@@ -998,7 +998,7 @@ BOOL LLMotionController::deactivateMotionInstance(LLMotion *motion)
 	else
 	{
 		// for motions that we are keeping, simply remove from active queue
-		mActiveMotions.erase(motion);
+		mActiveMotions.remove(motion);
 	}
 
 	return TRUE;
@@ -1062,7 +1062,7 @@ void LLMotionController::dumpMotions()
 			state_string += std::string("l");
 		if (mLoadedMotions.find(motion) != mLoadedMotions.cend())
 			state_string += std::string("L");
-		if (mActiveMotions.find(motion) != mActiveMotions.cend())
+		if (std::find(mActiveMotions.cbegin(), mActiveMotions.cend(), motion)!=mActiveMotions.cend())
 			state_string += std::string("A");
 		if (mDeprecatedMotions.find(motion) != mDeprecatedMotions.cend())
 			state_string += std::string("D");
diff --git a/indra/llcharacter/llmotioncontroller.h b/indra/llcharacter/llmotioncontroller.h
index f10d0d49e3e86699b1c74382c2702531046bbe7f..3099ab9de2743197b0999b3ff260320811867e67 100644
--- a/indra/llcharacter/llmotioncontroller.h
+++ b/indra/llcharacter/llmotioncontroller.h
@@ -83,6 +83,7 @@ class LLMotionController
 {
 public:
 	using motion_set_t = absl::flat_hash_set<LLMotion*>;
+	using motion_list_t = std::list<LLMotion*>;
 	using motion_deque_t = std::deque<LLMotion*>;
 	BOOL mIsSelf;
 	
@@ -212,7 +213,7 @@ protected:
 
 	motion_set_t		mLoadingMotions;
 	motion_set_t		mLoadedMotions;
-	motion_set_t		mActiveMotions;
+	motion_list_t		mActiveMotions;
 	motion_set_t		mDeprecatedMotions;
 	
 	LLFrameTimer		mTimer;