Skip to content

Commit 2733ceb

Browse files
committed
Updated some uses of P_LineOpening to always use finite openings on polyobject lines, and removed D_MAXINT assumptions
1 parent fbaaa45 commit 2733ceb

3 files changed

Lines changed: 15 additions & 11 deletions

File tree

source/p_map.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,9 @@ bool PIT_CheckLine(line_t *ld, polyobj_t *po, void *context)
861861

862862
// At this point we have backsector
863863

864-
if(P_AnySlope(*ld))
864+
bool anyslope = P_AnySlope(*ld);
865+
866+
if(anyslope || ld->intflags & MLI_DYNASEGLINE)
865867
{
866868
// Find the two intersections with the bounding box
867869
v2fixed_t i1, i2;
@@ -873,7 +875,8 @@ bool PIT_CheckLine(line_t *ld, polyobj_t *po, void *context)
873875

874876
P_UpdateFromOpening(lo, ld, clip, UO_SAMEGROUPID, 0, 0);
875877

876-
pcl->haveslopes = true;
878+
if(anyslope)
879+
pcl->haveslopes = true;
877880
}
878881
else
879882
{
@@ -2442,6 +2445,7 @@ static bool PTR_SlideTraverse(intercept_t *in, void *context, const divline_t &)
24422445

24432446
li = in->d.line;
24442447

2448+
v2fixed_t edgepos;
24452449
if(!(li->flags & ML_TWOSIDED))
24462450
{
24472451
if(P_PointOnLineSide(slidemo->x, slidemo->y, li))
@@ -2456,15 +2460,16 @@ static bool PTR_SlideTraverse(intercept_t *in, void *context, const divline_t &)
24562460
// set openrange, opentop, openbottom.
24572461
// These define a 'window' from one sector to another across a line
24582462

2459-
clip.open = P_LineOpening(li, slidemo);
2463+
edgepos = trace.dl.v + trace.dl.dv.fixedMul(in->frac);
2464+
clip.open = P_LineOpening(li, slidemo, &edgepos);
24602465

24612466
if(clip.open.range < slidemo->height)
24622467
goto isblocking; // doesn't fit
24632468

2464-
if(clip.open.height.ceiling < D_MAXINT && clip.open.height.ceiling - slidemo->z < slidemo->height)
2469+
if(clip.open.height.ceiling - slidemo->z < slidemo->height)
24652470
goto isblocking; // mobj is too high
24662471

2467-
if(clip.open.height.floor > D_MININT && clip.open.height.floor - slidemo->z > STEPSIZE)
2472+
if(clip.open.height.floor - slidemo->z > STEPSIZE)
24682473
goto isblocking; // too big a step up
24692474
else if(P_Use3DClipping() && slidemo->z < clip.open.height.floor) // haleyjd: OVER_UNDER
24702475
{

source/p_portalclip.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,10 @@ bool PIT_CheckLine3D(line_t *ld, polyobj_t *po, void *context)
421421
// better detection of in-portal lines
422422
uint32_t lineclipflags = 0;
423423

424-
if(haveSlopes)
424+
if(haveSlopes || ld->intflags & MLI_DYNASEGLINE)
425425
{
426-
pcl->haveslopes = true;
426+
if(haveSlopes)
427+
pcl->haveslopes = true;
427428
if(!calculatedSlopes) // may have already calculated them when checking cross-portal heights
428429
P_ExactBoxLinePoints(bbox, *ld, i1, i2);
429430

source/p_trace.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,16 +139,14 @@ static bool PTR_AimTraverse(intercept_t *in, void *context, const divline_t &tra
139139

140140
dist = FixedMul(trace.attackrange, in->frac);
141141

142-
if(li->frontsector->srf.floor.getZAt(edgepos) != li->backsector->srf.floor.getZAt(edgepos) &&
143-
(demo_version < 406 || clip.open.height.floor != D_MININT))
142+
if(li->frontsector->srf.floor.getZAt(edgepos) != li->backsector->srf.floor.getZAt(edgepos))
144143
{
145144
slope = FixedDiv(clip.open.height.floor - trace.z, dist);
146145
if(slope > trace.bottomslope)
147146
trace.bottomslope = slope;
148147
}
149148

150-
if(li->frontsector->srf.ceiling.getZAt(edgepos) != li->backsector->srf.ceiling.getZAt(edgepos) &&
151-
(demo_version < 406 || clip.open.height.ceiling != D_MAXINT))
149+
if(li->frontsector->srf.ceiling.getZAt(edgepos) != li->backsector->srf.ceiling.getZAt(edgepos))
152150
{
153151
slope = FixedDiv(clip.open.height.ceiling - trace.z, dist);
154152
if(slope < trace.topslope)

0 commit comments

Comments
 (0)