From 82e9257284bfebd5a34d112eb87954bcf6c04817 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Mon, 21 Aug 2023 01:40:05 -0400 Subject: [PATCH] Fix frequent legacy GL crash that Jeck is getting This uses `gl_frontsector`, which can sometimes be NULL. --- src/hardware/hw_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 976d210c2..145a6b464 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -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;