From 334dfe0587ee374b478a41a04bc4ebcd11d3b7af Mon Sep 17 00:00:00 2001
From: ruslantproductengine <ruslantproductengine@lindenlab.com>
Date: Mon, 24 Apr 2017 20:19:48 +0300
Subject: [PATCH] MAINT-6275 - Child prim not touchable after being resized and
 moved relative to root prim by script.

FIXED.
It's a very important on each cycle on Drawable::update form(), when object
remained in move, list update the CurrentScale member, because if do not do that,
it remained in this list forever or when the delta time between two frames
a become a sufficiently large (due to interpolation)
for overcome the MIN_INTERPOLATE_DISTANCE_SQUARED.
---
 indra/newview/lldrawable.cpp | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp
index aa67ea25243..0c47e0f0eef 100644
--- a/indra/newview/lldrawable.cpp
+++ b/indra/newview/lldrawable.cpp
@@ -618,7 +618,7 @@ F32 LLDrawable::updateXform(BOOL undamped)
 	BOOL damped = !undamped;
 
 	// Position
-	LLVector3 old_pos(mXform.getPosition());
+	const LLVector3 old_pos(mXform.getPosition());
 	LLVector3 target_pos;
 	if (mXform.isRoot())
 	{
@@ -632,7 +632,7 @@ F32 LLDrawable::updateXform(BOOL undamped)
 	}
 	
 	// Rotation
-	LLQuaternion old_rot(mXform.getRotation());
+	const LLQuaternion old_rot(mXform.getRotation());
 	LLQuaternion target_rot = mVObjp->getRotation();
 	//scaling
 	LLVector3 target_scale = mVObjp->getScale();
@@ -667,6 +667,8 @@ F32 LLDrawable::updateXform(BOOL undamped)
 		{
 			// snap to final position (only if no target omega is applied)
 			dist_squared = 0.0f;
+			mCurrentScale = target_scale;
+
 			if (getVOVolume() && !isRoot())
 			{ //child prim snapping to some position, needs a rebuild
 				gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE);
@@ -683,11 +685,11 @@ F32 LLDrawable::updateXform(BOOL undamped)
 		//dist_squared += dist_vec_squared(old_scale, target_scale);
 	}
 
-	LLVector3 vec = mCurrentScale-target_scale;
+	const LLVector3 vec = mCurrentScale-target_scale;
+	mCurrentScale = target_scale;
 	
 	if (vec*vec > MIN_INTERPOLATE_DISTANCE_SQUARED)
 	{ //scale change requires immediate rebuild
-		mCurrentScale = target_scale;
 		gPipeline.markRebuild(this, LLDrawable::REBUILD_POSITION, TRUE);
 	}
 	else if (!isRoot() && 
-- 
GitLab