X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=r_light.c;h=8f906ef7766a10c738d99a5ce7290e52938eab29;hp=1990bbd0fbed37c5f5f8b694659c5c28e29bc73b;hb=697da87440cb50b17feea1c256b48c73434bcb89;hpb=d474b5b66a73bf8b639003491001c2dcbe84785e diff --git a/r_light.c b/r_light.c index 1990bbd0..8f906ef7 100644 --- a/r_light.c +++ b/r_light.c @@ -184,7 +184,7 @@ static void R_RecursiveMarkLights(entity_render_t *ent, vec3_t lightorigin, dlig float dist; // for comparisons to minimum acceptable light - while(node->contents >= 0) + while(node->plane) { dist = PlaneDiff(lightorigin, node->plane); if (dist > light->rtlight.lightmap_cullradius) @@ -202,15 +202,14 @@ static void R_RecursiveMarkLights(entity_render_t *ent, vec3_t lightorigin, dlig i = leaf->clusterindex; if (leaf->nummarksurfaces && (i >= pvsbits || CHECKPVSBIT(pvs, i))) { - int *surfacevisframes, d, impacts, impactt; + int d, impacts, impactt; float sdist, maxdist, dist2, impact[3]; msurface_t *surf; // mark the polygons maxdist = light->rtlight.lightmap_cullradius2; - surfacevisframes = ent->model->brushq1.surfacevisframes; for (i = 0;i < leaf->nummarksurfaces;i++) { - if (surfacevisframes[leaf->firstmarksurface[i]] != r_framecount) + if (ent == r_refdef.worldentity && !r_worldsurfacevisible[leaf->firstmarksurface[i]]) continue; surf = ent->model->brushq1.surfaces + leaf->firstmarksurface[i]; dist = sdist = PlaneDiff(lightorigin, surf->plane);