From 1fe2a59637db5e37c79e889e6668a2a904642520 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Sun, 11 Nov 2018 23:55:26 +0100 Subject: [PATCH] (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]"). --- game/Game_local.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/game/Game_local.cpp b/game/Game_local.cpp index b680165..a0d9ec1 100644 --- a/game/Game_local.cpp +++ b/game/Game_local.cpp @@ -3869,15 +3869,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 );