mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-12-28 13:21:10 +00:00
Merge branch 'climbing_shit' into 'next'
Climbing on one-sided linedefs Does what it says on the tin. You couldn't before, now you can. With this branch, thok barriers are now completely optional for maps with no aesthetic need for sky-topped walls. All the bugs and complications that exist with climbing right now still exist, except now there's one less issue making them suck forever and now Nev3r will be very happy. Do I need a testing .wad? It's... not that hard to create a very small map and go nuts with Knuckles in it. I have one, but uploading it to the ftp almost feels insulting. See merge request !90
This commit is contained in:
commit
a938efa328
2 changed files with 246 additions and 236 deletions
|
@ -2423,6 +2423,8 @@ isblocking:
|
||||||
//
|
//
|
||||||
// P_IsClimbingValid
|
// P_IsClimbingValid
|
||||||
//
|
//
|
||||||
|
// Unlike P_DoClimbing, don't use when up against a one-sided linedef.
|
||||||
|
//
|
||||||
static boolean P_IsClimbingValid(player_t *player, angle_t angle)
|
static boolean P_IsClimbingValid(player_t *player, angle_t angle)
|
||||||
{
|
{
|
||||||
fixed_t platx, platy;
|
fixed_t platx, platy;
|
||||||
|
@ -2647,6 +2649,7 @@ isblocking:
|
||||||
// see about climbing on the wall
|
// see about climbing on the wall
|
||||||
if (!(checkline->flags & ML_NOCLIMB))
|
if (!(checkline->flags & ML_NOCLIMB))
|
||||||
{
|
{
|
||||||
|
boolean canclimb; // FUCK C90
|
||||||
angle_t climbangle, climbline;
|
angle_t climbangle, climbline;
|
||||||
INT32 whichside = P_PointOnLineSide(slidemo->x, slidemo->y, li);
|
INT32 whichside = P_PointOnLineSide(slidemo->x, slidemo->y, li);
|
||||||
|
|
||||||
|
@ -2657,9 +2660,11 @@ isblocking:
|
||||||
|
|
||||||
climbangle += (ANGLE_90 * (whichside ? -1 : 1));
|
climbangle += (ANGLE_90 * (whichside ? -1 : 1));
|
||||||
|
|
||||||
|
canclimb = (li->backsector ? P_IsClimbingValid(slidemo->player, climbangle) : true);
|
||||||
|
|
||||||
if (((!slidemo->player->climbing && abs((signed)(slidemo->angle - ANGLE_90 - climbline)) < ANGLE_45)
|
if (((!slidemo->player->climbing && abs((signed)(slidemo->angle - ANGLE_90 - climbline)) < ANGLE_45)
|
||||||
|| (slidemo->player->climbing == 1 && abs((signed)(slidemo->angle - climbline)) < ANGLE_135))
|
|| (slidemo->player->climbing == 1 && abs((signed)(slidemo->angle - climbline)) < ANGLE_135))
|
||||||
&& P_IsClimbingValid(slidemo->player, climbangle))
|
&& canclimb)
|
||||||
{
|
{
|
||||||
slidemo->angle = climbangle;
|
slidemo->angle = climbangle;
|
||||||
if (!demoplayback || P_AnalogMove(slidemo->player))
|
if (!demoplayback || P_AnalogMove(slidemo->player))
|
||||||
|
|
|
@ -2284,9 +2284,9 @@ static void P_DoClimbing(player_t *player)
|
||||||
platx = P_ReturnThrustX(player->mo, player->mo->angle, player->mo->radius + FixedMul(8*FRACUNIT, player->mo->scale));
|
platx = P_ReturnThrustX(player->mo, player->mo->angle, player->mo->radius + FixedMul(8*FRACUNIT, player->mo->scale));
|
||||||
platy = P_ReturnThrustY(player->mo, player->mo->angle, player->mo->radius + FixedMul(8*FRACUNIT, player->mo->scale));
|
platy = P_ReturnThrustY(player->mo, player->mo->angle, player->mo->radius + FixedMul(8*FRACUNIT, player->mo->scale));
|
||||||
|
|
||||||
glidesector = R_PointInSubsector(player->mo->x + platx, player->mo->y + platy);
|
glidesector = R_IsPointInSubsector(player->mo->x + platx, player->mo->y + platy);
|
||||||
|
|
||||||
if (glidesector->sector != player->mo->subsector->sector)
|
if (!glidesector || glidesector->sector != player->mo->subsector->sector)
|
||||||
{
|
{
|
||||||
boolean floorclimb;
|
boolean floorclimb;
|
||||||
boolean thrust;
|
boolean thrust;
|
||||||
|
@ -2298,6 +2298,8 @@ static void P_DoClimbing(player_t *player)
|
||||||
boostup = false;
|
boostup = false;
|
||||||
skyclimber = false;
|
skyclimber = false;
|
||||||
|
|
||||||
|
if (glidesector)
|
||||||
|
{
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
floorheight = glidesector->sector->f_slope ? P_GetZAt(glidesector->sector->f_slope, player->mo->x, player->mo->y)
|
floorheight = glidesector->sector->f_slope ? P_GetZAt(glidesector->sector->f_slope, player->mo->x, player->mo->y)
|
||||||
: glidesector->sector->floorheight;
|
: glidesector->sector->floorheight;
|
||||||
|
@ -2590,6 +2592,9 @@ static void P_DoClimbing(player_t *player)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
floorclimb = true;
|
||||||
|
|
||||||
if (player->lastsidehit != -1 && player->lastlinehit != -1)
|
if (player->lastsidehit != -1 && player->lastlinehit != -1)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue