Fix frequent legacy GL crash that Jeck is getting

This uses `gl_frontsector`, which can sometimes be NULL.
This commit is contained in:
Sally Coolatta 2023-08-21 01:40:05 -04:00
parent 21706c6edf
commit 82e9257284

View file

@ -310,7 +310,7 @@ static FUINT HWR_CalcSlopeLight(FUINT lightnum, pslope_t *slope, const sector_t
{
INT16 finallight = lightnum;
if (slope != NULL && P_ApplyLightOffsetFine(lightnum, sector))
if (slope != NULL && sector != NULL && P_ApplyLightOffsetFine(lightnum, sector))
{
finallight += slope->hwLightOffset;