From 1593ba70411e1473b5a13bcfabd5de796b191b5d Mon Sep 17 00:00:00 2001 From: NepDisk <16447892+NepDisk@users.noreply.github.com> Date: Fri, 13 Sep 2024 15:33:38 -0400 Subject: [PATCH] Fix midtexture stepup issue Thanks Indev!!!! --- src/info.c | 2 +- src/p_map.c | 2 +- src/p_maputl.c | 30 ++++++------------------------ src/p_maputl.h | 2 +- 4 files changed, 9 insertions(+), 27 deletions(-) diff --git a/src/info.c b/src/info.c index cd78e6192..7985d7b28 100644 --- a/src/info.c +++ b/src/info.c @@ -5134,7 +5134,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // xdeathstate sfx_None, // deathsound 1, // speed - 24*FRACUNIT, // radius + 16*FRACUNIT, // radius 48*FRACUNIT, // height 0, // display offset 1000, // mass diff --git a/src/p_map.c b/src/p_map.c index 4b4030880..5b8e0d8c7 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1614,7 +1614,7 @@ static BlockItReturn_t PIT_CheckLine(line_t *ld) { fixed_t textop, texbottom; - P_GetMidtextureTopBottom(ld, tm.x, tm.y, + P_GetMidtextureTopBottom(ld, &open, &textop, &texbottom); /* The effect handling is done later but it won't diff --git a/src/p_maputl.c b/src/p_maputl.c index d353300e1..b86f3d686 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -422,8 +422,7 @@ void P_CameraLineOpening(line_t *linedef, opening_t *open) boolean P_GetMidtextureTopBottom ( line_t * linedef, - fixed_t x, - fixed_t y, + opening_t *open, fixed_t * return_top, fixed_t * return_bottom) { @@ -437,23 +436,6 @@ P_GetMidtextureTopBottom if (!texnum) return false; - - textop = P_GetSectorCeilingZAt(front, x, y); - texbottom = P_GetSectorFloorZAt(front, x, y); - - if (back) - { - z = P_GetSectorCeilingZAt(back, x, y); - - if (z < textop) - textop = z; - - z = P_GetSectorFloorZAt(back, x, y); - - if (z > texbottom) - texbottom = z; - } - // Get the midtexture's height texheight = textures[texnum]->height << FRACBITS; @@ -484,17 +466,17 @@ P_GetMidtextureTopBottom { if ((linedef->flags & ML_WRAPMIDTEX) && !side->repeatcnt) // "infinite" repeat { - texbottom += side->rowoffset; - textop += side->rowoffset; + texbottom = open->floor + side->rowoffset; + textop = open->ceiling + side->rowoffset; } else if (linedef->flags & ML_MIDPEG) { - texbottom += side->rowoffset; + texbottom = open->floor + side->rowoffset; textop = texbottom + texheight*(side->repeatcnt+1); } else { - textop += side->rowoffset; + textop = open->ceiling + side->rowoffset; texbottom = textop - texheight*(side->repeatcnt+1); } } @@ -633,7 +615,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj, opening_t *open) fixed_t textop, texbottom; fixed_t texmid, delta1, delta2; - if (P_GetMidtextureTopBottom(linedef, cross.x, cross.y, &textop, &texbottom)) + if (P_GetMidtextureTopBottom(linedef, open, &textop, &texbottom)) { texmid = texbottom+(textop-texbottom)/2; diff --git a/src/p_maputl.h b/src/p_maputl.h index 78efaa254..1037df52b 100644 --- a/src/p_maputl.h +++ b/src/p_maputl.h @@ -72,7 +72,7 @@ void P_SetPrecipitationThingPosition(precipmobj_t *thing); void P_CreatePrecipSecNodeList(precipmobj_t *thing, fixed_t x,fixed_t y); void P_HitSpecialLines(mobj_t *thing, fixed_t x, fixed_t y, fixed_t momx, fixed_t momy); -boolean P_GetMidtextureTopBottom(line_t *linedef, fixed_t x, fixed_t y, fixed_t *return_top, fixed_t *return_bottom); +boolean P_GetMidtextureTopBottom(line_t *linedef, opening_t *open, fixed_t *return_top, fixed_t *return_bottom); typedef enum {