Solved the climbing-on-one-sided-lines problem another way, using the last touched line's attributes.

(After talking to Alam, we can't have floats anywhere near P_ functions, so.)
This commit is contained in:
toasterbabe 2016-08-13 14:16:06 +01:00
parent 5d6463fafc
commit 612575620b
3 changed files with 15 additions and 37 deletions

View file

@ -2657,7 +2657,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 boolean canclimb;
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);

View file

@ -2276,25 +2276,24 @@ static void P_DoClimbing(player_t *player)
fixed_t platy; fixed_t platy;
subsector_t *glidesector; subsector_t *glidesector;
boolean climb = true; 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)); 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_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 floorclimb = false;
boolean thrust; boolean thrust = false;
boolean boostup; boolean boostup = false;
boolean skyclimber; boolean skyclimber = false;
fixed_t floorheight, ceilingheight; // ESLOPE fixed_t floorheight, ceilingheight; // ESLOPE
thrust = false;
floorclimb = false;
boostup = false;
skyclimber = false;
if (glidesector) if (onesided)
floorclimb = true;
else
{ {
#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)
@ -2589,8 +2588,6 @@ static void P_DoClimbing(player_t *player)
} }
} }
} }
else
floorclimb = true;
if (player->lastsidehit != -1 && player->lastlinehit != -1) if (player->lastsidehit != -1 && player->lastlinehit != -1)
{ {

View file

@ -33,7 +33,6 @@
#ifdef HWRENDER #ifdef HWRENDER
#include "hardware/hw_main.h" #include "hardware/hw_main.h"
#include "hardware/hw_glob.h" // polyvertex_t
#endif #endif
//profile stuff --------------------------------------------------------- //profile stuff ---------------------------------------------------------
@ -269,28 +268,10 @@ INT32 R_PointOnSide(fixed_t x, fixed_t y, node_t *node)
// killough 5/2/98: reformatted // killough 5/2/98: reformatted
INT32 R_PointOnSegSide(fixed_t x, fixed_t y, seg_t *line) INT32 R_PointOnSegSide(fixed_t x, fixed_t y, seg_t *line)
{ {
fixed_t lx, ly, ldx, ldy; fixed_t lx = line->v1->x;
fixed_t ly = line->v1->y;
#ifdef HWRENDER // how did nobody notice this for years fixed_t ldx = line->v2->x - lx;
// used for the hardware render fixed_t ldy = line->v2->y - ly;
if (rendermode != render_soft && rendermode != render_none)
{
lx = FLOAT_TO_FIXED(((polyvertex_t *)line->v1)->x);
ly = FLOAT_TO_FIXED(((polyvertex_t *)line->v1)->y);
ldx = FLOAT_TO_FIXED(((polyvertex_t *)line->v2)->x);
ldy = FLOAT_TO_FIXED(((polyvertex_t *)line->v2)->y);
}
else
#endif
{
lx = line->v1->x;
ly = line->v1->y;
ldx = line->v2->x;
ldy = line->v2->y;
}
ldx -= lx;
ldy -= ly;
if (!ldx) if (!ldx)
return x <= lx ? ldy > 0 : ldy < 0; return x <= lx ? ldy > 0 : ldy < 0;