From 95ed442d55a13ee6d74b23e01fa7d3cc8da94070 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 23 Nov 2019 14:20:41 +0000 Subject: [PATCH] Prevent Knuckles latching onto horizon special linedefs. Also, update all references to the horizon special to use a #defined constant instead of a magic number. --- src/hardware/hw_main.c | 2 +- src/p_map.c | 2 +- src/r_defs.h | 2 ++ src/r_segs.c | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 5f0c25a59..51c976973 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -1973,7 +1973,7 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) { // Single sided line... Deal only with the middletexture (if one exists) gr_midtexture = R_GetTextureNum(gr_sidedef->midtexture); - if (gr_midtexture && gr_linedef->special != 41) // Ignore horizon line for OGL + if (gr_midtexture && gr_linedef->special != HORIZONSPECIAL) // Ignore horizon line for OGL { { fixed_t texturevpeg; diff --git a/src/p_map.c b/src/p_map.c index 97bff8156..753ce9eb5 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -3471,7 +3471,7 @@ isblocking: } // see about climbing on the wall - if (!(checkline->flags & ML_NOCLIMB)) + if (!(checkline->flags & ML_NOCLIMB) && checkline->special != HORIZONSPECIAL) { boolean canclimb; angle_t climbangle, climbline; diff --git a/src/r_defs.h b/src/r_defs.h index 4d41f4f70..6d0b10b70 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -410,6 +410,8 @@ typedef enum ST_NEGATIVE } slopetype_t; +#define HORIZONSPECIAL 41 + typedef struct line_s { // Vertices, from v1 to v2. diff --git a/src/r_segs.c b/src/r_segs.c index 6eb81ce7a..ee62bfc73 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -2694,7 +2694,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) worldbottomslope >>= 4; #endif - if (linedef->special == 41) { // HORIZON LINES + if (linedef->special == HORIZONSPECIAL) { // HORIZON LINES topstep = bottomstep = 0; topfrac = bottomfrac = (centeryfrac>>4); topfrac++; // Prevent 1px HOM @@ -2825,7 +2825,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) #ifdef ESLOPE ffloor[i].f_pos_slope >>= 4; #endif - if (linedef->special == 41) // Horizon lines extend FOFs in contact with them too. + if (linedef->special == HORIZONSPECIAL) // Horizon lines extend FOFs in contact with them too. { ffloor[i].f_step = 0; ffloor[i].f_frac = (centeryfrac>>4);