From b3472d89e79a69ad2d6943c4ad4946a7901b2270 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Sat, 7 Nov 2015 11:58:07 -0700 Subject: [PATCH] light: fix antilights which were broken with the light culling change --- light/ltface.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/light/ltface.c b/light/ltface.c index 1b99b617..683462ff 100644 --- a/light/ltface.c +++ b/light/ltface.c @@ -820,8 +820,9 @@ CullLight(const entity_t *entity, const lightsurf_t *lightsurf) return false; /* return true if the light level at the closest point on the - surface bounding sphere to the light source is <= fadegate */ - return GetLightValue(&entity->light, entity, dist) <= fadegate; + surface bounding sphere to the light source is <= fadegate. + need fabs to handle antilights. */ + return fabs(GetLightValue(&entity->light, entity, dist)) <= fadegate; } /* @@ -868,7 +869,7 @@ LightFace_Entity(const entity_t *entity, const lightsample_t *light, dist = VectorLength(ray); /* Quick distance check first */ - if (GetLightValue(&entity->light, entity, dist) <= fadegate) + if (fabs(GetLightValue(&entity->light, entity, dist)) <= fadegate) continue; /* Check spotlight cone */