From 045e46134c0006a2f4b93b34c50748606299491b Mon Sep 17 00:00:00 2001 From: Alug Date: Mon, 13 Jul 2026 07:41:01 +0200 Subject: [PATCH] this can be static its unused anyways also adds plane bounds check which was missing --- src/r_portal.c | 5 ++++- src/r_portal.h | 1 - 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/r_portal.c b/src/r_portal.c index d84a99be4..00baad528 100644 --- a/src/r_portal.c +++ b/src/r_portal.c @@ -272,7 +272,7 @@ static boolean TrimVisplaneBounds(const visplane_t* plane, INT16* start, INT16* * Applies the necessary offsets and rotation to give * a depth illusion to the skybox. */ -void Portal_AddSkybox(const visplane_t* plane) +static void Portal_AddSkybox(const visplane_t* plane) { INT16 start, end; mapheader_t *mh; @@ -337,6 +337,9 @@ void Portal_AddSkyboxPortals(void) { for (pl = visplanes[i]; pl; pl = pl->next) { + if (pl->minx >= pl->maxx) + continue; + if (pl->picnum == skyflatnum) { Portal_AddSkybox(pl); diff --git a/src/r_portal.h b/src/r_portal.h index 223dd83be..4c4583903 100644 --- a/src/r_portal.h +++ b/src/r_portal.h @@ -58,7 +58,6 @@ void Portal_Add2Lines (const INT32 line1, const INT32 line2, const INT32 x1, con void Portal_ClipApply (const portal_t* portal); -void Portal_AddSkybox(const visplane_t* plane); void Portal_AddSkyboxPortals(void); #ifdef __cplusplus