mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-10 06:41:41 +00:00
- fixed: The CHECKSWITCHRANGE line flag was ignored for one sided lines.
SVN r1570 (trunk)
This commit is contained in:
parent
0d1d15eba8
commit
a9c396a8ce
2 changed files with 12 additions and 3 deletions
|
@ -1,4 +1,5 @@
|
|||
May 3, 2009 (Changes by Graf Zahl)
|
||||
- fixed: The CHECKSWITCHRANGE line flag was ignored for one sided lines.
|
||||
- Added more compatibility settings, submitted by Gez.
|
||||
|
||||
May 2, 2009 (Changes by Graf Zahl)
|
||||
|
|
|
@ -464,8 +464,7 @@ static int TryFindSwitch (side_t *side, int Where)
|
|||
//
|
||||
bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno)
|
||||
{
|
||||
// if this line is one sided this function must always return success.
|
||||
if (line->sidenum[0] == NO_SIDE || line->sidenum[1] == NO_SIDE) return true;
|
||||
if (line->sidenum[0] == NO_SIDE) return true;
|
||||
|
||||
fixed_t checktop;
|
||||
fixed_t checkbot;
|
||||
|
@ -492,9 +491,18 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno)
|
|||
checkx = dll.x + FixedMul(dll.dx, inter);
|
||||
checky = dll.y + FixedMul(dll.dy, inter);
|
||||
|
||||
// one sided line
|
||||
if (line->sidenum[1] == NO_SIDE)
|
||||
{
|
||||
onesided:
|
||||
fixed_t sectorc = line->frontsector->ceilingplane.ZatPoint(checkx, checky);
|
||||
fixed_t sectorf = line->frontsector->floorplane.ZatPoint(checkx, checky);
|
||||
return (user->z + user->height >= sectorf && user->z <= sectorc);
|
||||
}
|
||||
|
||||
// Now get the information from the line.
|
||||
P_LineOpening(open, NULL, line, checkx, checky, user->x, user->y);
|
||||
if (open.range <= 0) return true;
|
||||
if (open.range <= 0) goto onesided;
|
||||
|
||||
if ((TryFindSwitch (side, side_t::top)) != -1)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue