mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
Changed IsPointInMap to use P_PointOnDivlineSide.
This commit is contained in:
parent
ed72843dec
commit
cdd60b1431
1 changed files with 6 additions and 9 deletions
|
@ -85,7 +85,7 @@
|
|||
#include "g_levellocals.h"
|
||||
#include "actorinlines.h"
|
||||
#include "i_time.h"
|
||||
#include "nodebuild.h"
|
||||
#include "p_maputl.h"
|
||||
|
||||
void STAT_StartNewGame(const char *lev);
|
||||
void STAT_ChangeLevel(const char *newl);
|
||||
|
@ -2023,13 +2023,10 @@ bool IsPointInMap(DVector3 p)
|
|||
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);
|
||||
|
|
Loading…
Reference in a new issue