- added compatibility flag for buggy CheckSwitchRange behavior

https://forum.zdoom.org/viewtopic.php?t=63008
https://forum.zdoom.org/viewtopic.php?t=63650
This commit is contained in:
alexey.lysiuk 2019-02-11 16:26:11 +02:00 committed by Christoph Oelckers
commit d4d010ac32
8 changed files with 17 additions and 4 deletions

View file

@ -194,7 +194,9 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno, const DVector3 *
}
}
return (user->Top() > open.top);
return (user->Level->i_compatflags2 & COMPATF2_CHECKSWITCHRANGE)
? (user->Top() >= open.top)
: (user->Top() > open.top);
}
else if ((TexMan.FindSwitch(side->GetTexture(side_t::bottom))) != NULL)
{
@ -216,7 +218,9 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno, const DVector3 *
}
}
return (user->Z() < open.bottom);
return (user->Level->i_compatflags2 & COMPATF2_CHECKSWITCHRANGE)
? (user->Z() <= open.bottom)
: (user->Z() < open.bottom);
}
else if ((flags & ML_3DMIDTEX) || (TexMan.FindSwitch(side->GetTexture(side_t::mid))) != NULL)
{
@ -229,7 +233,9 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno, const DVector3 *
else
{
// no switch found. Check whether the player can touch either top or bottom texture
return (user->Top() > open.top) || (user->isBelow(open.bottom));
return (user->Level->i_compatflags2 & COMPATF2_CHECKSWITCHRANGE)
? ( (user->Top() >= open.top) || (user->Z() <= open.bottom) )
: ( (user->Top() > open.top) || user->isBelow(open.bottom) );
}
}