Fix hw_vertexbuilder lightmap nullptr error

This commit is contained in:
RaveYard 2023-09-07 04:22:26 +02:00 committed by Christoph Oelckers
parent dae78e2a2c
commit 3e96e9010e

View file

@ -240,7 +240,7 @@ static int CreateIndexedSectorVerticesLM(FRenderState& renderstate, sector_t* se
{
subsector_t* sub = sec->subsectors[i];
DoomLevelMeshSurface* lightmap = sub->lightmap[h][lightmapIndex];
if (lightmap->Type != ST_UNKNOWN)
if (lightmap && lightmap->Type != ST_UNKNOWN) // lightmap may be missing if the subsector is degenerate triangle
{
float* luvs = lightmap->TexCoords;
int lindex = lightmap->LightmapNum;