mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 13:01:47 +00:00
- 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:
parent
6369a88e0f
commit
158f32bcda
2 changed files with 11 additions and 5 deletions
|
@ -121,9 +121,15 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno)
|
||||||
fixed_t checkbot;
|
fixed_t checkbot;
|
||||||
sector_t *front = side->sector;
|
sector_t *front = side->sector;
|
||||||
FLineOpening open;
|
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.
|
// 3DMIDTEX forces CHECKSWITCHRANGE because otherwise it might cause problems.
|
||||||
if (!(line->flags & (ML_3DMIDTEX|ML_CHECKSWITCHRANGE)))
|
if (!(flags & (ML_3DMIDTEX|ML_CHECKSWITCHRANGE)))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
// calculate the point where the user would touch the wall.
|
// 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)
|
if (open.range <= 0)
|
||||||
goto onesided;
|
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);
|
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);
|
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
|
// 3DMIDTEX lines will force a mid texture check if no switch is found on this line
|
||||||
// to keep compatibility with Eternity's implementation.
|
// to keep compatibility with Eternity's implementation.
|
||||||
|
|
Loading…
Reference in a new issue