mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Add FOF behavior switch to P_LineOpening
Finally fixes the very specific issue on Endless Mine ( https://cdn.discordapp.com/attachments/1006454720686202951/1106749881663631420/image.png )
This commit is contained in:
parent
6fa821b2d3
commit
002e25905b
3 changed files with 68 additions and 19 deletions
|
|
@ -754,24 +754,30 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj, opening_t *open)
|
||||||
|
|
||||||
if (delta1 > delta2)
|
if (delta1 > delta2)
|
||||||
{
|
{
|
||||||
if (polybottom < open->ceiling)
|
if (open->fofType != LO_FOF_FLOORS)
|
||||||
{
|
{
|
||||||
open->ceiling = polybottom;
|
if (polybottom < open->ceiling)
|
||||||
}
|
{
|
||||||
else if (polybottom < open->highceiling)
|
open->ceiling = polybottom;
|
||||||
{
|
}
|
||||||
open->highceiling = polybottom;
|
else if (polybottom < open->highceiling)
|
||||||
|
{
|
||||||
|
open->highceiling = polybottom;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (polytop > open->floor)
|
if (open->fofType != LO_FOF_CEILINGS)
|
||||||
{
|
{
|
||||||
open->floor = polytop;
|
if (polytop > open->floor)
|
||||||
}
|
{
|
||||||
else if (polytop > open->lowfloor)
|
open->floor = polytop;
|
||||||
{
|
}
|
||||||
open->lowfloor = polytop;
|
else if (polytop > open->lowfloor)
|
||||||
|
{
|
||||||
|
open->lowfloor = polytop;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -811,15 +817,28 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj, opening_t *open)
|
||||||
|| (rover->fofflags & FOF_BLOCKOTHERS && !mobj->player)))
|
|| (rover->fofflags & FOF_BLOCKOTHERS && !mobj->player)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
topheight = P_GetFOFTopZ(mobj, front, rover, tm.x, tm.y, linedef);
|
if (open->fofType != LO_FOF_ANY)
|
||||||
bottomheight = P_GetFOFBottomZ(mobj, front, rover, tm.x, tm.y, linedef);
|
{
|
||||||
|
topheight = P_VeryTopOfFOF(rover);
|
||||||
|
bottomheight = P_VeryBottomOfFOF(rover);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
topheight = P_GetFOFTopZ(mobj, front, rover, tm.x, tm.y, linedef);
|
||||||
|
bottomheight = P_GetFOFBottomZ(mobj, front, rover, tm.x, tm.y, linedef);
|
||||||
|
}
|
||||||
|
|
||||||
midheight = bottomheight + (topheight - bottomheight) / 2;
|
midheight = bottomheight + (topheight - bottomheight) / 2;
|
||||||
delta1 = abs(mobj->z - midheight);
|
delta1 = abs(mobj->z - midheight);
|
||||||
delta2 = abs(thingtop - midheight);
|
delta2 = abs(thingtop - midheight);
|
||||||
|
|
||||||
if (delta1 >= delta2)
|
if (delta1 > delta2)
|
||||||
{
|
{
|
||||||
|
if (open->fofType == LO_FOF_FLOORS)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// thing is below FOF
|
// thing is below FOF
|
||||||
if ((rover->fofflags & FOF_INTANGIBLEFLATS) != FOF_PLATFORM)
|
if ((rover->fofflags & FOF_INTANGIBLEFLATS) != FOF_PLATFORM)
|
||||||
{
|
{
|
||||||
|
|
@ -832,6 +851,11 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj, opening_t *open)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (open->fofType == LO_FOF_CEILINGS)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// thing is above FOF
|
// thing is above FOF
|
||||||
if ((rover->fofflags & FOF_INTANGIBLEFLATS) != FOF_REVERSEPLATFORM)
|
if ((rover->fofflags & FOF_INTANGIBLEFLATS) != FOF_REVERSEPLATFORM)
|
||||||
{
|
{
|
||||||
|
|
@ -858,15 +882,28 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj, opening_t *open)
|
||||||
|| (rover->fofflags & FOF_BLOCKOTHERS && !mobj->player)))
|
|| (rover->fofflags & FOF_BLOCKOTHERS && !mobj->player)))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
topheight = P_GetFOFTopZ(mobj, back, rover, tm.x, tm.y, linedef);
|
if (open->fofType != LO_FOF_ANY)
|
||||||
bottomheight = P_GetFOFBottomZ(mobj, back, rover, tm.x, tm.y, linedef);
|
{
|
||||||
|
topheight = P_VeryTopOfFOF(rover);
|
||||||
|
bottomheight = P_VeryBottomOfFOF(rover);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
topheight = P_GetFOFTopZ(mobj, back, rover, tm.x, tm.y, linedef);
|
||||||
|
bottomheight = P_GetFOFBottomZ(mobj, back, rover, tm.x, tm.y, linedef);
|
||||||
|
}
|
||||||
|
|
||||||
midheight = bottomheight + (topheight - bottomheight) / 2;
|
midheight = bottomheight + (topheight - bottomheight) / 2;
|
||||||
delta1 = abs(mobj->z - midheight);
|
delta1 = abs(mobj->z - midheight);
|
||||||
delta2 = abs(thingtop - midheight);
|
delta2 = abs(thingtop - midheight);
|
||||||
|
|
||||||
if (delta1 >= delta2)
|
if (delta1 > delta2)
|
||||||
{
|
{
|
||||||
|
if (open->fofType == LO_FOF_FLOORS)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// thing is below FOF
|
// thing is below FOF
|
||||||
if ((rover->fofflags & FOF_INTANGIBLEFLATS) != FOF_PLATFORM)
|
if ((rover->fofflags & FOF_INTANGIBLEFLATS) != FOF_PLATFORM)
|
||||||
{
|
{
|
||||||
|
|
@ -879,6 +916,11 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj, opening_t *open)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (open->fofType == LO_FOF_CEILINGS)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// thing is above FOF
|
// thing is above FOF
|
||||||
if ((rover->fofflags & FOF_INTANGIBLEFLATS) != FOF_REVERSEPLATFORM)
|
if ((rover->fofflags & FOF_INTANGIBLEFLATS) != FOF_REVERSEPLATFORM)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -70,8 +70,13 @@ struct opening_t
|
||||||
fixed_t ceilingstep, ceilingdrop;
|
fixed_t ceilingstep, ceilingdrop;
|
||||||
fixed_t floorstep, floordrop;
|
fixed_t floorstep, floordrop;
|
||||||
INT32 ceilingpic, floorpic;
|
INT32 ceilingpic, floorpic;
|
||||||
|
UINT8 fofType; // LO_FOF_ types for forcing FOF collide
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define LO_FOF_ANY (0)
|
||||||
|
#define LO_FOF_FLOORS (1)
|
||||||
|
#define LO_FOF_CEILINGS (2)
|
||||||
|
|
||||||
void P_LineOpening(line_t *plinedef, mobj_t *mobj, opening_t *open);
|
void P_LineOpening(line_t *plinedef, mobj_t *mobj, opening_t *open);
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
|
|
|
||||||
|
|
@ -384,6 +384,7 @@ static boolean P_CanBotTraverse(seg_t *seg, divline_t *divl, register los_t *los
|
||||||
tm.y = los->strace.y + FixedMul(los->strace.dy, frac);
|
tm.y = los->strace.y + FixedMul(los->strace.dy, frac);
|
||||||
|
|
||||||
// set openrange, opentop, openbottom
|
// set openrange, opentop, openbottom
|
||||||
|
open.fofType = (flip ? LO_FOF_CEILINGS : LO_FOF_FLOORS);
|
||||||
P_LineOpening(line, los->t1, &open);
|
P_LineOpening(line, los->t1, &open);
|
||||||
maxstep = P_GetThingStepUp(los->t1, tm.x, tm.y);
|
maxstep = P_GetThingStepUp(los->t1, tm.x, tm.y);
|
||||||
|
|
||||||
|
|
@ -451,10 +452,11 @@ static boolean P_CanWaypointTraverse(seg_t *seg, divline_t *divl, register los_t
|
||||||
tm.y = los->strace.y + FixedMul(los->strace.dy, frac);
|
tm.y = los->strace.y + FixedMul(los->strace.dy, frac);
|
||||||
|
|
||||||
// set openrange, opentop, openbottom
|
// set openrange, opentop, openbottom
|
||||||
|
open.fofType = (flip ? LO_FOF_CEILINGS : LO_FOF_FLOORS);
|
||||||
P_LineOpening(line, los->t1, &open);
|
P_LineOpening(line, los->t1, &open);
|
||||||
maxstep = P_GetThingStepUp(los->t1, tm.x, tm.y);
|
maxstep = P_GetThingStepUp(los->t1, tm.x, tm.y);
|
||||||
|
|
||||||
#if 1
|
#if 0
|
||||||
if (los->t2->type == MT_WAYPOINT)
|
if (los->t2->type == MT_WAYPOINT)
|
||||||
{
|
{
|
||||||
waypoint_t *wp = K_SearchWaypointHeapForMobj(los->t2);
|
waypoint_t *wp = K_SearchWaypointHeapForMobj(los->t2);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue