Crashfix; Change llassert_always to llassert + llwarns. This way users don't get disruptive crashes.

Nicky 2012-07-21 14:18:10 +02:00
parent 02d5451cfa
commit aca20e85fb
1 changed files with 22 additions and 2 deletions

View File

@ -534,8 +534,28 @@ void LLVertexBuffer::drawArrays(U32 mode, const std::vector<LLVector3>& pos, con
gGL.syncMatrices();
U32 count = pos.size();
llassert_always(norm.size() >= pos.size());
llassert_always(count > 0);
// <FS:ND> Don't crash, but just warn and exit out. This should be safe to do and won't disrupt the user with a crash
// llassert_always(norm.size() >= pos.size());
// llassert_always(count > 0);
llassert(norm.size() >= pos.size());
llassert(count > 0);
if( count == 0 )
{
llwarns << "Called drawArrays with 0 vertices" << llendl;
return;
}
if( norm.size() < pos.size() )
{
llwarns << "Called drawArrays with #" << norm.size() << " normals and #" << pos.size() << " vertices" << llendl;
return;
}
// </FS:ND>
unbind();