diff --git a/src/rendering/hwrenderer/doom_levelmesh.cpp b/src/rendering/hwrenderer/doom_levelmesh.cpp index 59d0f59bf..931c9485e 100644 --- a/src/rendering/hwrenderer/doom_levelmesh.cpp +++ b/src/rendering/hwrenderer/doom_levelmesh.cpp @@ -2036,7 +2036,7 @@ void DoomLevelMesh::SaveLightmapLump(FLevelLocals& doomMap) for (unsigned int i = 0; i < Lightmap.Tiles.Size(); i++) { LightmapTile* tile = &Lightmap.Tiles[i]; - if (tile->AtlasLocation.ArrayIndex != -1 || tile->AtlasLocation.ArrayIndex < Lightmap.TextureCount) + if (tile->AtlasLocation.ArrayIndex != -1 && tile->AtlasLocation.ArrayIndex < Lightmap.TextureCount) { tileCount++; pixelCount += tile->AtlasLocation.Area();