Merge branch 'climbingshit2_electricboogaloo' into 'master'

Climbing shit 2 electric boogaloo: an adventure in how much toast hates how the ogl renderer was implemented

Fixed Knuckles being able to climb in space in OpenGL.

Using the last-touched line instead of R_IsPointInSubsector because FLOAT_TO_FIXED is bad in P_ functions

To understand the original problem: look at AjustSegs(void) in hw_bsp.c. It reallocates the vetex_t pointers for lines as POLYVERTEX_T pointers, and of COURSE things are gonna get wacky when you're casting pointers.

This merge request is into master because it's a bug that's IN master and must never reach the public because of how bad it is

See merge request !101
This commit is contained in:
Wolfy 2016-08-25 14:18:44 -04:00
commit 831c29ead7
3 changed files with 12 additions and 15 deletions

View File

@ -2657,7 +2657,7 @@ isblocking:
// see about climbing on the wall
if (!(checkline->flags & ML_NOCLIMB))
{
boolean canclimb; // FUCK C90
boolean canclimb;
angle_t climbangle, climbline;
INT32 whichside = P_PointOnLineSide(slidemo->x, slidemo->y, li);

View File

@ -2276,25 +2276,24 @@ static void P_DoClimbing(player_t *player)
fixed_t platy;
subsector_t *glidesector;
boolean climb = true;
boolean onesided = ((player->lastsidehit != -1 && player->lastlinehit != -1) && !(lines[player->lastlinehit].backsector));
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));
glidesector = R_IsPointInSubsector(player->mo->x + platx, player->mo->y + platy);
glidesector = R_PointInSubsector(player->mo->x + platx, player->mo->y + platy);
if (!glidesector || glidesector->sector != player->mo->subsector->sector)
if (onesided || glidesector->sector != player->mo->subsector->sector)
{
boolean floorclimb;
boolean thrust;
boolean boostup;
boolean skyclimber;
boolean floorclimb = false;
boolean thrust = false;
boolean boostup = false;
boolean skyclimber = false;
fixed_t floorheight, ceilingheight; // ESLOPE
thrust = false;
floorclimb = false;
boostup = false;
skyclimber = false;
if (glidesector)
if (onesided)
floorclimb = true;
else
{
#ifdef ESLOPE
floorheight = glidesector->sector->f_slope ? P_GetZAt(glidesector->sector->f_slope, player->mo->x, player->mo->y)
@ -2589,8 +2588,6 @@ static void P_DoClimbing(player_t *player)
}
}
}
else
floorclimb = true;
if (player->lastsidehit != -1 && player->lastlinehit != -1)
{

View File

@ -771,7 +771,7 @@ subsector_t *R_PointInSubsector(fixed_t x, fixed_t y)
}
//
// R_IsPointInSubsector, same as above but returns 0 if not in subsector
// R_IsPointInSubsector, same as above but returns 0 if not in subsector - this does not work in opengl because of polyvertex_t
//
subsector_t *R_IsPointInSubsector(fixed_t x, fixed_t y)
{