Changed IsPointInMap to use P_PointOnDivlineSide.

This commit is contained in:
Major Cooke 2018-11-08 07:26:42 -06:00 committed by Christoph Oelckers
parent ed72843dec
commit cdd60b1431

View file

@ -85,7 +85,7 @@
#include "g_levellocals.h" #include "g_levellocals.h"
#include "actorinlines.h" #include "actorinlines.h"
#include "i_time.h" #include "i_time.h"
#include "nodebuild.h" #include "p_maputl.h"
void STAT_StartNewGame(const char *lev); void STAT_StartNewGame(const char *lev);
void STAT_ChangeLevel(const char *newl); void STAT_ChangeLevel(const char *newl);
@ -2023,13 +2023,10 @@ bool IsPointInMap(DVector3 p)
seg_t *seg = subsector->firstline + i; seg_t *seg = subsector->firstline + i;
if (seg->backsector != nullptr) continue; if (seg->backsector != nullptr) continue;
int sx = (int)seg->v1->fX(); divline_t dline;
int sy = (int)seg->v1->fY(); P_MakeDivline(seg->linedef, &dline);
int dx = (int)seg->v2->fX() - sx; bool pol = P_PointOnDivlineSide(p.XY(), &dline) < 1;
int dy = (int)seg->v2->fY() - sy; if (!pol) return false;
int res = FNodeBuilder::PointOnSide(sx, sy, (int)p.X, (int)p.Y, dx, dy);
bool pointOnSide = (res > 0);
if (!pointOnSide) return false;
} }
double ceilingZ = subsector->sector->ceilingplane.ZatPoint(p.X, p.Y); double ceilingZ = subsector->sector->ceilingplane.ZatPoint(p.X, p.Y);