diff options
Diffstat (limited to 'src/renderergl1')
-rw-r--r-- | src/renderergl1/tr_light.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/renderergl1/tr_light.c b/src/renderergl1/tr_light.c index bd79df55..35233739 100644 --- a/src/renderergl1/tr_light.c +++ b/src/renderergl1/tr_light.c @@ -183,6 +183,9 @@ static void R_SetupEntityLightingGrid( trRefEntity_t *ent ) { data = gridData; for ( j = 0 ; j < 3 ; j++ ) { if ( i & (1<<j) ) { + if ( pos[j] + 1 > tr.world->lightGridBounds[j] - 1 ) { + break; // ignore values outside lightgrid + } factor *= frac[j]; data += gridStep[j]; } else { @@ -190,6 +193,9 @@ static void R_SetupEntityLightingGrid( trRefEntity_t *ent ) { } } + if ( j != 3 ) { + continue; + } if ( !(data[0]+data[1]+data[2]) ) { continue; // ignore samples in walls } |