From d6fb3da55c4e01a8e613f7ea842967e63b6b3285 Mon Sep 17 00:00:00 2001 From: Andrey Nazarov Date: Fri, 8 Dec 2023 01:34:04 +0300 Subject: [PATCH] Simplify GL_RebuildLighting(). It's more correct to call LM_BeginBuilding() if toggling lightmaps off, because it will reset nummaps/maxmaps. --- src/refresh/surf.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/refresh/surf.c b/src/refresh/surf.c index 3146c4b22..dbb956edd 100644 --- a/src/refresh/surf.c +++ b/src/refresh/surf.c @@ -947,13 +947,7 @@ void GL_RebuildLighting(void) if (!gl_static.world.cache) return; - // if doing vertex lighting, rebuild all surfaces - if (no_lightmaps()) { - upload_world_surfaces(); - return; - } - - // if did vertex lighting previously, rebuild all surfaces and lightmaps + // rebuild all surfaces if toggling lightmaps off/on if (gl_fullbright->modified || gl_vertexlight->modified) { LM_BeginBuilding(); upload_world_surfaces();