mirror of
https://github.com/dhewm/dhewm3-sdk.git
synced 2025-02-27 06:01:10 +00:00
(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:
parent
f0ff1f878d
commit
4a2d4751ac
1 changed files with 6 additions and 4 deletions
|
@ -3835,15 +3835,17 @@ void idGameLocal::ProjectDecal( const idVec3 &origin, const idVec3 &dir, float d
|
||||||
idVec3( 1.0f, -1.0f, 0.0f )
|
idVec3( 1.0f, -1.0f, 0.0f )
|
||||||
};
|
};
|
||||||
|
|
||||||
if ( !g_decals.GetBool() ) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// DG: with size 0 we get trouble in functions called from this,
|
// DG: with size 0 we get trouble in functions called from this,
|
||||||
// and it's harder to figure out the cause there
|
// 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)
|
// so just catch this here (so please fix the caller to make sure it doesn't happen)
|
||||||
assert(size > 0.0f);
|
assert(size > 0.0f);
|
||||||
|
|
||||||
|
if ( !g_decals.GetBool() || size <= 0.0f ) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// randomly rotate the decal winding
|
// randomly rotate the decal winding
|
||||||
idMath::SinCos16( ( angle ) ? angle : random.RandomFloat() * idMath::TWO_PI, s, c );
|
idMath::SinCos16( ( angle ) ? angle : random.RandomFloat() * idMath::TWO_PI, s, c );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue