mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'block-monsters' into 'master'
Bring back block monsters, but as a line type instead of a flag See merge request KartKrew/Kart!341
This commit is contained in:
commit
617ffe0978
1 changed files with 21 additions and 16 deletions
37
src/p_map.c
37
src/p_map.c
|
|
@ -1624,6 +1624,23 @@ static boolean PIT_CheckCameraLine(line_t *ld)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static boolean P_IsLineBlocking(const line_t *ld, const mobj_t *thing)
|
||||||
|
{
|
||||||
|
// missiles can cross uncrossable lines
|
||||||
|
if ((thing->flags & MF_MISSILE))
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return
|
||||||
|
(
|
||||||
|
(ld->flags & ML_IMPASSABLE) || // block objects from moving through this linedef.
|
||||||
|
(thing->player && !thing->player->spectator &&
|
||||||
|
ld->flags & ML_BLOCKPLAYERS) || // SRB2Kart: Only block players, not items
|
||||||
|
((thing->flags & (MF_ENEMY|MF_BOSS)) && ld->special == 81) // case 81: block monsters only
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// PIT_CheckLine
|
// PIT_CheckLine
|
||||||
// Adjusts tmfloorz and tmceilingz as lines are contacted
|
// Adjusts tmfloorz and tmceilingz as lines are contacted
|
||||||
|
|
@ -1699,14 +1716,8 @@ static boolean PIT_CheckLine(line_t *ld)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// missiles can cross uncrossable lines
|
if (P_IsLineBlocking(ld, tmthing))
|
||||||
if (!(tmthing->flags & MF_MISSILE))
|
return false;
|
||||||
{
|
|
||||||
if (ld->flags & ML_IMPASSABLE) // block objects from moving through this linedef.
|
|
||||||
return false;
|
|
||||||
if (tmthing->player && !tmthing->player->spectator && ld->flags & ML_BLOCKPLAYERS)
|
|
||||||
return false; // SRB2Kart: Only block players, not items
|
|
||||||
}
|
|
||||||
|
|
||||||
// set openrange, opentop, openbottom
|
// set openrange, opentop, openbottom
|
||||||
P_LineOpening(ld, tmthing);
|
P_LineOpening(ld, tmthing);
|
||||||
|
|
@ -3172,14 +3183,8 @@ static boolean PTR_LineIsBlocking(line_t *li)
|
||||||
if (!li->backsector)
|
if (!li->backsector)
|
||||||
return !P_PointOnLineSide(slidemo->x, slidemo->y, li);
|
return !P_PointOnLineSide(slidemo->x, slidemo->y, li);
|
||||||
|
|
||||||
if (!(slidemo->flags & MF_MISSILE))
|
if (P_IsLineBlocking(li, slidemo))
|
||||||
{
|
return true;
|
||||||
if (li->flags & ML_IMPASSABLE)
|
|
||||||
return true;
|
|
||||||
|
|
||||||
if (slidemo->player && !slidemo->player->spectator && li->flags & ML_BLOCKPLAYERS)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// set openrange, opentop, openbottom
|
// set openrange, opentop, openbottom
|
||||||
P_LineOpening(li, slidemo);
|
P_LineOpening(li, slidemo);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue