prevent division by zero, which spreads darkness during bounces

source of the problem is located somewhere else
This commit is contained in:
Garux 2021-01-05 01:34:55 +03:00
parent e62c6f4bb3
commit b2bc2077e5

View File

@ -792,6 +792,12 @@ static bool MapTriangle( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert_t *
return false;
}
/* this must not happen in the first place, but it does and spreads result of division by zero in MapSingleLuxel all over the map during -bounce */
if( lm->vecs != NULL && plane[lm->axisNum] == 0 ){
Sys_Warning( "plane[lm->axisNum] == 0\n" );
return false;
}
/* check to see if we need to calculate texture->world tangent vectors */
if ( info->si->normalImage != NULL && CalcTangentVectors( 3, dv, stvStatic, ttvStatic ) ) {
stv = stvStatic;