Changed IsPointInMap to use P_PointOnDivlineSide.

This commit is contained in:
Major Cooke 2018-11-08 07:26:42 -06:00 committed by drfrag666
parent b34bc0947e
commit 484a44a0be

View file

@ -96,7 +96,7 @@
#include "actorinlines.h"
#include "vm.h"
#include "i_time.h"
#include "nodebuild.h"
#include "p_maputl.h"
#include <string.h>
@ -2005,14 +2005,11 @@ bool IsPointInMap(DVector3 p)
// Skip single sided lines.
seg_t *seg = subsector->firstline + i;
if (seg->backsector != nullptr) continue;
int sx = (int)seg->v1->fX();
int sy = (int)seg->v1->fY();
int dx = (int)seg->v2->fX() - sx;
int dy = (int)seg->v2->fY() - sy;
int res = FNodeBuilder::PointOnSide(sx, sy, (int)p.X, (int)p.Y, dx, dy);
bool pointOnSide = (res > 0);
if (!pointOnSide) return false;
divline_t dline;
P_MakeDivline(seg->linedef, &dline);
bool pol = P_PointOnDivlineSide(p.XY(), &dline) < 1;
if (!pol) return false;
}
double ceilingZ = subsector->sector->ceilingplane.ZatPoint(p.X, p.Y);