- fixed: The CHECKSWITCHRANGE line flag was ignored for one sided lines.

SVN r1570 (trunk)
This commit is contained in:
Christoph Oelckers 2009-05-03 21:12:52 +00:00
parent 0d1d15eba8
commit a9c396a8ce
2 changed files with 12 additions and 3 deletions

View file

@ -1,4 +1,5 @@
May 3, 2009 (Changes by Graf Zahl) 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. - Added more compatibility settings, submitted by Gez.
May 2, 2009 (Changes by Graf Zahl) May 2, 2009 (Changes by Graf Zahl)

View file

@ -464,8 +464,7 @@ static int TryFindSwitch (side_t *side, int Where)
// //
bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno) 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) return true;
if (line->sidenum[0] == NO_SIDE || line->sidenum[1] == NO_SIDE) return true;
fixed_t checktop; fixed_t checktop;
fixed_t checkbot; fixed_t checkbot;
@ -492,9 +491,18 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno)
checkx = dll.x + FixedMul(dll.dx, inter); checkx = dll.x + FixedMul(dll.dx, inter);
checky = dll.y + FixedMul(dll.dy, 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. // Now get the information from the line.
P_LineOpening(open, NULL, line, checkx, checky, user->x, user->y); 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) if ((TryFindSwitch (side, side_t::top)) != -1)
{ {