Fix nullptr crash in HWWall::BuildFFBlock

This commit is contained in:
RaveYard 2023-09-18 11:52:44 +02:00 committed by Christoph Oelckers
parent ec94204a28
commit b8146e323c

View file

@ -1658,9 +1658,9 @@ void HWWall::BuildFFBlock(HWDrawInfo *di, FRenderState& state, seg_t * seg, F3DF
lightmap = nullptr; lightmap = nullptr;
if (seg->sidedef == seg->linedef->sidedef[0]) if (seg->sidedef == seg->linedef->sidedef[0])
lightmap = seg->linedef->sidedef[1]->lightmap[4 + roverIndex]; lightmap = seg->linedef->sidedef[1]->lightmap ? seg->linedef->sidedef[1]->lightmap[4 + roverIndex] : nullptr;
else else
lightmap = seg->linedef->sidedef[0]->lightmap[4 + roverIndex]; lightmap = seg->linedef->sidedef[0]->lightmap ? seg->linedef->sidedef[0]->lightmap[4 + roverIndex] : nullptr;
if (rover->flags&FF_FOG) if (rover->flags&FF_FOG)
{ {