(Hopefully) fix one of the assertions rarely happening in Rivensen

I hope I guessed this right: This could prevent the rare assertion
in RenderWorld.cpp:954 ("bounds[0][0] <= bounds[1][0]
  && bounds[0][1] <= bounds[1][1] && bounds[0][2] <= bounds[1][2]").
This commit is contained in:
Daniel Gibson 2018-11-11 23:55:26 +01:00
parent f0ff1f878d
commit 4a2d4751ac

View file

@ -3835,15 +3835,17 @@ void idGameLocal::ProjectDecal( const idVec3 &origin, const idVec3 &dir, float d
idVec3( 1.0f, -1.0f, 0.0f )
};
if ( !g_decals.GetBool() ) {
return;
}
// DG: with size 0 we get trouble in functions called from this,
// and it's harder to figure out the cause there
// so just catch this here (so please fix the caller to make sure it doesn't happen)
assert(size > 0.0f);
if ( !g_decals.GetBool() || size <= 0.0f ) {
return;
}
// randomly rotate the decal winding
idMath::SinCos16( ( angle ) ? angle : random.RandomFloat() * idMath::TWO_PI, s, c );