From f6655bd2ae4aca0fa309ee1fdbcc515d6606b949 Mon Sep 17 00:00:00 2001
From: andreykproductengine <andreykproductengine@lindenlab.com>
Date: Wed, 6 Sep 2017 17:38:56 +0300
Subject: [PATCH] Backed out changeset: ab07c3c8d1ea (MAINT-5013)

---
 indra/newview/llvoavatar.cpp | 15 +++++----------
 indra/newview/llvoavatar.h   |  2 +-
 2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index 1658adea08b..398b33b5abb 100644
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -5260,13 +5260,13 @@ void LLVOAvatar::resetAnimations()
 
 // Override selectively based on avatar sex and whether we're using new
 // animations.
-LLUUID LLVOAvatar::remapMotionID(const LLUUID& id, ESex gender)
+LLUUID LLVOAvatar::remapMotionID(const LLUUID& id)
 {
 	BOOL use_new_walk_run = gSavedSettings.getBOOL("UseNewWalkRun");
 	LLUUID result = id;
 
 	// start special case female walk for female avatars
-	if (gender == SEX_FEMALE)
+	if (getSex() == SEX_FEMALE)
 	{
 		if (id == ANIM_AGENT_WALK)
 		{
@@ -5316,7 +5316,7 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset)
 {
 	LL_DEBUGS() << "motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << LL_ENDL;
 
-	LLUUID remap_id = remapMotionID(id, getSex());
+	LLUUID remap_id = remapMotionID(id);
 
 	if (remap_id != id)
 	{
@@ -5338,13 +5338,8 @@ BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate)
 {
 	LL_DEBUGS() << "motion requested " << id.asString() << " " << gAnimLibrary.animationName(id) << LL_ENDL;
 
-	LLUUID remap_id = remapMotionID(id, getSex());
-	if (findMotion(remap_id) == NULL)
-	{
-		//possibility of encountering animation from the previous gender
-		remap_id = remapMotionID(id, (getSex() == SEX_MALE) ? SEX_FEMALE : SEX_MALE);
-	}
-
+	LLUUID remap_id = remapMotionID(id);
+	
 	if (remap_id != id)
 	{
 		LL_DEBUGS() << "motion resultant " << remap_id.asString() << " " << gAnimLibrary.animationName(remap_id) << LL_ENDL;
diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h
index 253d9c24f3a..bd89d4ef23a 100644
--- a/indra/newview/llvoavatar.h
+++ b/indra/newview/llvoavatar.h
@@ -188,7 +188,7 @@ class LLVOAvatar :
 	/*virtual*/ LLVector3    	getCharacterVelocity();
 	/*virtual*/ LLVector3    	getCharacterAngularVelocity();
 
-	/*virtual*/ LLUUID			remapMotionID(const LLUUID& id, ESex gender);
+	/*virtual*/ LLUUID			remapMotionID(const LLUUID& id);
 	/*virtual*/ BOOL			startMotion(const LLUUID& id, F32 time_offset = 0.f);
 	/*virtual*/ BOOL			stopMotion(const LLUUID& id, BOOL stop_immediate = FALSE);
 	virtual bool			hasMotionFromSource(const LLUUID& source_id);
-- 
GitLab