- Fixed P_CheckSwitchRange() should not force range checking of lines flagged with ML_3DMIDTEX

if they do not have a midtexture.

SVN r3601 (trunk)
This commit is contained in:
Randy Heit 2012-04-27 03:17:56 +00:00
parent 6369a88e0f
commit 158f32bcda
2 changed files with 11 additions and 5 deletions

View file

@ -288,7 +288,7 @@ bool P_ActivateLine (line_t *line, AActor *mo, int side, int activationType)
bool P_TestActivateLine (line_t *line, AActor *mo, int side, int activationType)
{
int lineActivation = line->activation;
int lineActivation = line->activation;
if (line->flags & ML_FIRSTSIDEONLY && side == 1)
{

View file

@ -121,9 +121,15 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno)
fixed_t checkbot;
sector_t *front = side->sector;
FLineOpening open;
int flags = line->flags;
if (!side->GetTexture(side_t::mid).isValid())
{ // Do not force range checks for 3DMIDTEX lines if there is no actual midtexture.
flags &= ~ML_3DMIDTEX;
}
// 3DMIDTEX forces CHECKSWITCHRANGE because otherwise it might cause problems.
if (!(line->flags & (ML_3DMIDTEX|ML_CHECKSWITCHRANGE)))
if (!(flags & (ML_3DMIDTEX|ML_CHECKSWITCHRANGE)))
return true;
// calculate the point where the user would touch the wall.
@ -169,15 +175,15 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno)
if (open.range <= 0)
goto onesided;
if ((TexMan.FindSwitch (side->GetTexture(side_t::top))) != NULL)
if ((TexMan.FindSwitch(side->GetTexture(side_t::top))) != NULL)
{
return (user->z + user->height >= open.top);
}
else if ((TexMan.FindSwitch (side->GetTexture(side_t::bottom))) != NULL)
else if ((TexMan.FindSwitch(side->GetTexture(side_t::bottom))) != NULL)
{
return (user->z <= open.bottom);
}
else if ((line->flags & (ML_3DMIDTEX)) || (TexMan.FindSwitch (side->GetTexture(side_t::mid))) != NULL)
else if ((flags & ML_3DMIDTEX) || (TexMan.FindSwitch(side->GetTexture(side_t::mid))) != NULL)
{
// 3DMIDTEX lines will force a mid texture check if no switch is found on this line
// to keep compatibility with Eternity's implementation.