From 7a3faf34e790f63f40563fc2f0fdfb41cfec8230 Mon Sep 17 00:00:00 2001 From: Alug Date: Fri, 13 Jun 2025 00:02:51 +0200 Subject: [PATCH] move this into an if else saves us a little work --- src/r_plane.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/r_plane.cpp b/src/r_plane.cpp index 24c3cb086..e7a9d008c 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -442,7 +442,13 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, } } - if (slope != NULL && P_ApplyLightOffset(lightlevel >> LIGHTSEGSHIFT, lighting_sector)) + // This appears to fix the Nimbus Ruins sky bug. + if (picnum == skyflatnum && pfloor) + { + height = 0; // all skies map together + lightlevel = 0; + } + else if (slope != NULL && P_ApplyLightOffset(lightlevel >> LIGHTSEGSHIFT, lighting_sector)) { if (reverseLight) { @@ -454,20 +460,15 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, } } - // This appears to fix the Nimbus Ruins sky bug. - if (picnum == skyflatnum && pfloor) - { - height = 0; // all skies map together - lightlevel = 0; - } - if (!pfloor) { hash = visplane_hash(picnum, lightlevel, height); + for (check = visplanes[hash]; check; check = check->next) { if (polyobj != check->polyobj) continue; + if (height == check->height && picnum == check->picnum && lightlevel == check->lightlevel && xoff == check->xoffs && yoff == check->yoffs