From 4cbbb44a23cde8e2c681bf63e9d8345db029efb8 Mon Sep 17 00:00:00 2001 From: Kevin Shanahan Date: Sat, 2 Mar 2013 11:30:49 +1030 Subject: [PATCH] light: minor tidy up of spot falloff check in SingleLightFace Signed-off-by: Kevin Shanahan --- light/ltface.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/light/ltface.c b/light/ltface.c index b429f25f..5c99d27a 100644 --- a/light/ltface.c +++ b/light/ltface.c @@ -564,10 +564,11 @@ SingleLightFace(const entity_t *light, lightinfo_t * l, VectorSubtract(light->origin, surf, incoming); VectorNormalize(incoming); angle = DotProduct(incoming, l->facenormal); - if (light->spotlight && - DotProduct(light->spotvec, incoming) > light->spotfalloff) - /* spotlight cutoff */ - continue; + if (light->spotlight) { + vec_t falloff = DotProduct(light->spotvec, incoming); + if (falloff > light->spotfalloff) + continue; + } angle = (1.0 - scalecos) + scalecos * angle; add = scaledLight(CastRay(light->origin, surf), light);