From adb4f5d3e2fa8c1729454071171dac33c65845ff Mon Sep 17 00:00:00 2001 From: havoc Date: Tue, 3 May 2005 18:30:12 +0000 Subject: [PATCH] fix a bug that made rtlighting crash (thanks to Vic for reporting this) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5217 d7cf8633-e32d-0410-b094-e92efae38249 --- r_shadow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/r_shadow.c b/r_shadow.c index 09b79b3b..8c6972d1 100644 --- a/r_shadow.c +++ b/r_shadow.c @@ -1499,8 +1499,6 @@ void R_Shadow_RenderLighting(int firstvertex, int numvertices, int numtriangles, glosstexture = r_texture_black; specularscale = 0; } - if ((ambientscale + diffusescale) * (VectorLength2(lightcolorbase) + VectorLength2(lightcolorpants) + VectorLength2(lightcolorshirt)) + specularscale * VectorLength2(lightcolorbase) <= 0.001) - return; if (!basetexture) basetexture = r_texture_white; if (!bumptexture) @@ -1511,6 +1509,8 @@ void R_Shadow_RenderLighting(int firstvertex, int numvertices, int numtriangles, lightcolorpants = vec3_origin; if (!lightcolorshirt) lightcolorshirt = vec3_origin; + if ((ambientscale + diffusescale) * (VectorLength2(lightcolorbase) + VectorLength2(lightcolorpants) + VectorLength2(lightcolorshirt)) + specularscale * VectorLength2(lightcolorbase) <= 0.001) + return; if (visiblelighting) { int passes = 0; -- 2.39.2