- if (!r_vertexsurfaces.integer && surf->lightmaptexture != NULL)
- {
- if (surf->cached_dlight
- || surf->cached_ambient != r_ambient.value
- || surf->cached_lightmapscalebit != r_lightmapscalebit)
- R_BuildLightMap(ent, surf, false); // base lighting changed
- else if (r_dynamic.integer)
- {
- if (surf->styles[0] != 255 && (d_lightstylevalue[surf->styles[0]] != surf->cached_light[0]
- || (surf->styles[1] != 255 && (d_lightstylevalue[surf->styles[1]] != surf->cached_light[1]
- || (surf->styles[2] != 255 && (d_lightstylevalue[surf->styles[2]] != surf->cached_light[2]
- || (surf->styles[3] != 255 && (d_lightstylevalue[surf->styles[3]] != surf->cached_light[3]))))))))
- R_BuildLightMap(ent, surf, false); // base lighting changed
- else if (surf->dlightframe == r_framecount && r_dlightmap.integer)
- R_BuildLightMap(ent, surf, true); // only dlights
- }
- }
+ if (surf->cached_dlight && surf->lightmaptexture != NULL && !r_vertexsurfaces.integer)
+ R_BuildLightMap(ent, surf);