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
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

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