mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-02-20 18:42:17 +00:00
- calculate a proper opening range when encountering a sector portal on a one-sided line in the sight checking code
(cherry picked from commit ff1eb7f3f2
)
This commit is contained in:
parent
37b89faeb4
commit
c52d93ab36
1 changed files with 7 additions and 4 deletions
|
@ -158,6 +158,7 @@ public:
|
|||
void SightCheck::P_SightOpening(SightOpening &open, const line_t *linedef, double x, double y)
|
||||
{
|
||||
open.portalflags = 0;
|
||||
open.bottom = open.top = 0;
|
||||
sector_t *front = linedef->frontsector;
|
||||
sector_t *back = linedef->backsector;
|
||||
|
||||
|
@ -166,8 +167,10 @@ void SightCheck::P_SightOpening(SightOpening &open, const line_t *linedef, doubl
|
|||
// single sided line
|
||||
if (linedef->flags & ML_PORTALCONNECT)
|
||||
{
|
||||
if (!front->PortalBlocksSight(sector_t::ceiling)) open.portalflags |= SO_TOPFRONT;
|
||||
if (!front->PortalBlocksSight(sector_t::floor)) open.portalflags |= SO_BOTTOMFRONT;
|
||||
if (!front->PortalBlocksSight(sector_t::ceiling)) open.top = LINEOPEN_MAX, open.portalflags |= SO_TOPFRONT;
|
||||
if (!front->PortalBlocksSight(sector_t::floor)) open.bottom = LINEOPEN_MIN, open.portalflags |= SO_BOTTOMFRONT;
|
||||
if (open.top == 0) open.top = front->floorplane.ZatPoint(x, y);
|
||||
if (open.bottom == 0) open.bottom = front->ceilingplane.ZatPoint(x, y);
|
||||
}
|
||||
|
||||
open.range = 0;
|
||||
|
@ -220,7 +223,7 @@ bool SightCheck::PTR_SightTraverse (intercept_t *in)
|
|||
//
|
||||
|
||||
// ignore self referencing sectors if COMPAT_TRACE is on
|
||||
if ((i_compatflags & COMPATF_TRACE) && li->frontsector == li->backsector)
|
||||
if ((i_compatflags & COMPATF_TRACE) && li->frontsector == li->backsector)
|
||||
return true;
|
||||
|
||||
double trX = Trace.x + Trace.dx * in->frac;
|
||||
|
@ -231,7 +234,7 @@ bool SightCheck::PTR_SightTraverse (intercept_t *in)
|
|||
{
|
||||
// This may not skip P_SightOpening, but only reduce the open range to 0.
|
||||
open.range = 0;
|
||||
open.bottom = open.top;
|
||||
if (open.bottom != LINEOPEN_MIN) open.bottom = open.top;
|
||||
}
|
||||
|
||||
FLinePortal *lport = li->getPortal();
|
||||
|
|
Loading…
Reference in a new issue