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
This commit is contained in:
Roman Fomin 2021-02-16 16:06:02 +07:00 committed by GitHub
parent d14c65fe02
commit 70f2a0c2d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -495,6 +495,7 @@ fixed_t P_FindShortestTextureAround(int secnum)
{
const sector_t *sec = &sectors[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<<FRACBITS; //jff 3/13/98 prevent overflow in height calcs
@ -503,10 +504,10 @@ fixed_t P_FindShortestTextureAround(int secnum)
if (twoSided(secnum, i))
{
const side_t *side;
if ((side = getSide(secnum,i,0))->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 = &sectors[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<<FRACBITS; //jff 3/13/98 prevent overflow
@ -540,10 +542,10 @@ fixed_t P_FindShortestUpperAround(int secnum)
if (twoSided(secnum, i))
{
const side_t *side;
if ((side = getSide(secnum,i,0))->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];
}