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 "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);
|
||||||
|
|
Loading…
Reference in a new issue