remove some code duplication + add missing check

This commit is contained in:
Alug 2024-09-14 18:29:57 +02:00
parent 05d07927b8
commit e2f79aa308

View file

@ -2084,45 +2084,12 @@ void R_StoreWallRange(INT32 start, INT32 stop)
}
}
if (!bothceilingssky && !bothfloorssky || !udmf)
{
if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)
{
ds_p->sprbottomclip = negonearray;
ds_p->bsilheight = INT32_MAX;
ds_p->silhouette |= SIL_BOTTOM;
}
if (worldlow >= worldtop && worldlowslope >= worldtopslope)
{
ds_p->sprtopclip = screenheightarray;
ds_p->tsilheight = INT32_MIN;
ds_p->silhouette |= SIL_TOP;
}
}
//SoM: 3/25/2000: This code fixes an automap bug that didn't check
// frontsector->ceiling and backsector->floor to see if a door was closed.
// Without the following code, sprites get displayed behind closed doors.
if (!bothceilingssky && !bothfloorssky || !udmf)
{
if (doorclosed || (worldhigh <= worldbottom && worldhighslope <= worldbottomslope))
{
ds_p->sprbottomclip = negonearray;
ds_p->bsilheight = INT32_MAX;
ds_p->silhouette |= SIL_BOTTOM;
}
if (doorclosed || (worldlow >= worldtop && worldlowslope >= worldtopslope))
{ // killough 1/17/98, 2/8/98
ds_p->sprtopclip = screenheightarray;
ds_p->tsilheight = INT32_MIN;
ds_p->silhouette |= SIL_TOP;
}
//SoM: 3/25/2000: This code fixes an automap bug that didn't check
// frontsector->ceiling and backsector->floor to see if a door was closed.
// Without the following code, sprites get displayed behind closed doors.
if (udmf || !udmf && viewsector != frontsector && viewsector != backsector)
{
if (doorclosed || (worldhigh <= worldbottom && worldhighslope <= worldbottomslope))
{
@ -2130,8 +2097,9 @@ void R_StoreWallRange(INT32 start, INT32 stop)
ds_p->bsilheight = INT32_MAX;
ds_p->silhouette |= SIL_BOTTOM;
}
if (doorclosed || (worldlow >= worldtop && worldlowslope >= worldtopslope))
{ // killough 1/17/98, 2/8/98
{
ds_p->sprtopclip = screenheightarray;
ds_p->tsilheight = INT32_MIN;
ds_p->silhouette |= SIL_TOP;