summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2011-08-29 18:15:38 -0600
committerXiaohong Bao <bao@lindenlab.com>2011-08-29 18:15:38 -0600
commit8cef480b96dc779c5879f74224fb0a185ee550f2 (patch)
tree1eaae0ef23027ca1d4eecfe2410e0906be75880a /indra/newview/llvovolume.cpp
parentf054d44f9e2e0d152b1a0167b007eb10105487d6 (diff)
fix for SH-2311: crash at LLVOVolume::lineSegmentIntersect line 3435
and SH-2358: Crash in LLError::crashAndLoop: Invalid face index
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rwxr-xr-xindra/newview/llvovolume.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index d3ef1771c3..6b0a5d8642 100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1660,11 +1660,16 @@ BOOL LLVOVolume::updateGeometry(LLDrawable *drawable)
compiled = TRUE;
sNumLODChanges += new_num_faces ;
+ if((S32)getNumTEs() != getVolume()->getNumFaces())
+ {
+ setNumTEs(getVolume()->getNumFaces()); //mesh loading may change number of faces.
+ }
+
drawable->setState(LLDrawable::REBUILD_VOLUME); // for face->genVolumeTriangles()
{
LLFastTimer t(FTM_GEN_TRIANGLES);
- if (new_num_faces != old_num_faces)
+ if (new_num_faces != old_num_faces || mNumFaces != (S32)getNumTEs())
{
regenFaces();
}