From a847caade4e112906f86cfbd8511d3414d9546db Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Wed, 5 Feb 2014 16:16:30 -0700
Subject: [PATCH] more fix for a non-finite number assertion in llvolume

---
 indra/newview/llflexibleobject.cpp | 10 +++++++---
 indra/newview/llflexibleobject.h   |  2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp
index 3cd43678912..b64034b9450 100755
--- a/indra/newview/llflexibleobject.cpp
+++ b/indra/newview/llflexibleobject.cpp
@@ -722,13 +722,17 @@ void LLVolumeImplFlexible::preRebuild()
 	if (!mUpdated)
 	{
 		LL_RECORD_BLOCK_TIME(FTM_FLEXI_PREBUILD);
-		doFlexibleRebuild();
+		doFlexibleRebuild(false);
 	}
 }
 
-void LLVolumeImplFlexible::doFlexibleRebuild()
+void LLVolumeImplFlexible::doFlexibleRebuild(bool rebuild_volume)
 {
 	LLVolume* volume = mVO->getVolume();
+	if(rebuild_volume)
+	{
+		volume->setDirty();
+	}
 	volume->regen();
 	
 	mUpdated = TRUE;
@@ -801,7 +805,7 @@ BOOL LLVolumeImplFlexible::doUpdateGeometry(LLDrawable *drawable)
 		volume->dirtySpatialGroup();
 		{
 			LL_RECORD_BLOCK_TIME(FTM_FLEXIBLE_REBUILD);
-			doFlexibleRebuild();
+			doFlexibleRebuild(volume->mVolumeChanged);
 		}
 		volume->genBBoxes(isVolumeGlobal());
 	}
diff --git a/indra/newview/llflexibleobject.h b/indra/newview/llflexibleobject.h
index beb281a9062..a00551df8e1 100755
--- a/indra/newview/llflexibleobject.h
+++ b/indra/newview/llflexibleobject.h
@@ -100,7 +100,7 @@ class LLVolumeImplFlexible : public LLVolumeInterface
 		const LLMatrix4& getWorldMatrix(LLXformMatrix* xform) const;
 		void updateRelativeXform(bool force_identity);
 		void doFlexibleUpdate(); // Called to update the simulation
-		void doFlexibleRebuild(); // Called to rebuild the geometry
+		void doFlexibleRebuild(bool rebuild_volume); // Called to rebuild the geometry
 		void preRebuild();
 
 		//void				setAttributes( LLFlexibleObjectData );
-- 
GitLab