summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZack Middleton <zturtleman@gmail.com>2014-05-25 18:07:45 -0500
committerTim Angus <tim@ngus.net>2014-06-17 17:43:42 +0100
commit88423dcbc6114d685a80d8bdd267fd031c0f0545 (patch)
tree39efe82b5274beea8b5620f74389c11954363a85 /src
parentc6a8e47a09bb5be4ccce0d4a566a45c4e9355362 (diff)
Have OpenGL2 "map $lightmap" check for NULL tr.lightmaps too
Zero length lightmap lump will have NULL tr.lightmaps. OpenGL1 already has this check, because r_vertexLight 1 would crash Team Arena. OpenGL2 does not disable loading lightmaps when r_vertexLight is 1 though, so it does not have that issue.
Diffstat (limited to 'src')
-rw-r--r--src/renderergl2/tr_shader.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/renderergl2/tr_shader.c b/src/renderergl2/tr_shader.c
index 567d465b..afc8d80d 100644
--- a/src/renderergl2/tr_shader.c
+++ b/src/renderergl2/tr_shader.c
@@ -640,7 +640,7 @@ static qboolean ParseStage( shaderStage_t *stage, char **text )
else if ( !Q_stricmp( token, "$lightmap" ) )
{
stage->bundle[0].isLightmap = qtrue;
- if ( shader.lightmapIndex < 0 ) {
+ if ( shader.lightmapIndex < 0 || !tr.lightmaps ) {
stage->bundle[0].image[0] = tr.whiteImage;
} else {
stage->bundle[0].image[0] = tr.lightmaps[shader.lightmapIndex];