fix for SH-2311: crash at LLVOVolume::lineSegmentIntersect line 3435

and SH-2358: Crash in LLError::crashAndLoop: Invalid face index
meow-7.2.2
Xiaohong Bao 2011-08-29 18:15:38 -06:00
parent f054d44f9e
commit 8cef480b96
2 changed files with 7 additions and 2 deletions

View File

@ -2734,7 +2734,7 @@ void LLVolume::cacheOptimize()
S32 LLVolume::getNumFaces() const
{
return (S32)mProfilep->mFaces.size();
return mIsMeshAssetLoaded ? getNumVolumeFaces() : (S32)mProfilep->mFaces.size();
}

View File

@ -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();
}