One more save fix

This commit is contained in:
Magnus Norddahl 2024-12-12 23:10:13 +01:00
commit 2040be87a5

View file

@ -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)
if (tile->AtlasLocation.ArrayIndex != -1 || tile->AtlasLocation.ArrayIndex < Lightmap.TextureCount)
{
tileCount++;
pixelCount += tile->AtlasLocation.Area();