From 9c99cf29db06807fd96acfdbc6c59bbbbcd4a814 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sun, 25 May 2014 18:07:45 -0500 Subject: [PATCH] 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. --- code/renderergl2/tr_shader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/renderergl2/tr_shader.c b/code/renderergl2/tr_shader.c index 295dad7b..ed8212d2 100644 --- a/code/renderergl2/tr_shader.c +++ b/code/renderergl2/tr_shader.c @@ -639,7 +639,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];