+ if (CL_TraceLine(currentrenderentity->origin, sl->origin, NULL, NULL, 0, false) == 1)
+ {
+ if (currentrenderentity->numentlights < MAXENTLIGHTS)
+ currentrenderentity->entlights[currentrenderentity->numentlights++] = i;
+
+ // integrate mscale into falloff, for maximum speed
+ nl->falloff = mscale * sl->falloff;
+ // transform the light into the model's coordinate system
+ if (worldcoords)
+ VectorCopy(sl->origin, nl->origin);
+ else
+ softwareuntransform(sl->origin, nl->origin);
+ f = d_lightstylevalue[sl->style] * (1.0f / 65536.0f);
+ nl->light[0] = sl->light[0] * f * colorr;
+ nl->light[1] = sl->light[1] * f * colorg;
+ nl->light[2] = sl->light[2] * f * colorb;
+ //nl->cullradius2 = 99999999;
+ nl->lightsubtract = sl->subtract;
+ nl->offset = sl->distbias;
+ nl++;
+ nearlights++;
+ }
+ }
+ }
+ else
+ {
+ for (i = 0;i < currentrenderentity->numentlights && nearlights < MAX_DLIGHTS;i++)
+ {
+ sl = cl.worldmodel->lights + currentrenderentity->entlights[i];
+
+ // integrate mscale into falloff, for maximum speed
+ nl->falloff = mscale * sl->falloff;