From 70f2a0c2d0abe67054203d3851d3d7e43809064c Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Tue, 16 Feb 2021 16:06:02 +0700 Subject: [PATCH] fix P_FindShortestTextureAround (#126) * fix P_FindShortestTextureAround * fix position of M_PAUSE patch * Revert "fix position of M_PAUSE patch" This reverts commit 0d42ca4755639ca94b22720945f68ecd671dcd92. * add fix for P_FindShortestUpperAround and check for demo version * reformatted * delete blank line --- Source/p_spec.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/p_spec.c b/Source/p_spec.c index b961929a..42ac408f 100644 --- a/Source/p_spec.c +++ b/Source/p_spec.c @@ -495,6 +495,7 @@ fixed_t P_FindShortestTextureAround(int secnum) { const sector_t *sec = §ors[secnum]; int i, minsize = D_MAXINT; + int mintex = (demo_version < 203) ? 1 : 0; //jff 8/14/98 texture 0 is a placeholder if (!comp[comp_model]) minsize = 32000<bottomtexture >= 0 && + if ((side = getSide(secnum,i,0))->bottomtexture >= mintex && textureheight[side->bottomtexture] < minsize) minsize = textureheight[side->bottomtexture]; - if ((side = getSide(secnum,i,1))->bottomtexture >= 0 && + if ((side = getSide(secnum,i,1))->bottomtexture >= mintex && textureheight[side->bottomtexture] < minsize) minsize = textureheight[side->bottomtexture]; } @@ -531,6 +532,7 @@ fixed_t P_FindShortestUpperAround(int secnum) { const sector_t *sec = §ors[secnum]; int i, minsize = D_MAXINT; + int mintex = (demo_version < 203) ? 1 : 0; //jff 8/14/98 texture 0 is a placeholder if (!comp[comp_model]) minsize = 32000<toptexture >= 0) + if ((side = getSide(secnum,i,0))->toptexture >= mintex) if (textureheight[side->toptexture] < minsize) minsize = textureheight[side->toptexture]; - if ((side = getSide(secnum,i,1))->toptexture >= 0) + if ((side = getSide(secnum,i,1))->toptexture >= mintex) if (textureheight[side->toptexture] < minsize) minsize = textureheight[side->toptexture]; }