light: fix lighting with vis data

This commit is contained in:
Eric Wasylishen 2016-04-21 00:22:35 -06:00
parent 338ceae8c8
commit 0a8965bae0
1 changed files with 5 additions and 1 deletions

View File

@ -710,6 +710,7 @@ CalcPvs(const bsp2_t *bsp, lightsurf_t *lightsurf)
surfpoint = lightsurf->points[0];
for (i = 0; i < lightsurf->numpoints; i++, surfpoint += 3) {
const bsp2_dleaf_t *leaf = Light_PointInLeaf (bsp, surfpoint);
const int leafnum = leaf - bsp->dleafs;
if (leaf == NULL)
continue;
@ -726,6 +727,9 @@ CalcPvs(const bsp2_t *bsp, lightsurf_t *lightsurf)
else
DecompressVis (bsp, bsp->dvisdata + leaf->visofs, bsp->dvisdata + bsp->visdatasize, pointpvs);
/* mark this leaf as visible to itself (why is this not the case in the visdata!?!) */
pointpvs[leafnum>>3] |= (1<<(leafnum&7));
/* merge the pvs for this sample point into lightsurf->pvs */
for (j=0; j<pvssize; j++)
{