Merge branch 'lastlineshit' into 'next'

Allow player.lastlinehit and player.lastsidehit to be usable outside of Knuckles' climbing ability

See merge request STJr/SRB2!1271
This commit is contained in:
James R 2020-12-10 15:14:16 -05:00
commit 9a77cf6306
3 changed files with 15 additions and 9 deletions

View file

@ -3443,9 +3443,17 @@ static boolean PTR_SlideTraverse(intercept_t *in)
P_ProcessSpecialSector(slidemo->player, slidemo->subsector->sector, li->polyobj->lines[0]->backsector);
}
if (slidemo->player && slidemo->player->charability == CA_GLIDEANDCLIMB
&& (slidemo->player->pflags & PF_GLIDING || slidemo->player->climbing))
PTR_GlideClimbTraverse(li);
if (slidemo->player)
{
if (slidemo->player->charability == CA_GLIDEANDCLIMB
&& (slidemo->player->pflags & PF_GLIDING || slidemo->player->climbing))
PTR_GlideClimbTraverse(li);
else
{
slidemo->player->lastsidehit = li->sidenum[P_PointOnLineSide(slidemo->x, slidemo->y, li)];
slidemo->player->lastlinehit = (INT16)(li - lines);
}
}
if (in->frac < bestslidefrac && (!slidemo->player || !slidemo->player->climbing))
{

View file

@ -11396,6 +11396,10 @@ void P_SpawnPlayer(INT32 playernum)
p->normalspeed = skins[p->skin].normalspeed;
p->jumpfactor = skins[p->skin].jumpfactor;
}
// Clear lastlinehit and lastsidehit
p->lastsidehit = -1;
p->lastlinehit = -1;
//awayview stuff
p->awayviewmobj = NULL;

View file

@ -8609,12 +8609,6 @@ void P_MovePlayer(player_t *player)
player->climbing--;
}
if (!player->climbing)
{
player->lastsidehit = -1;
player->lastlinehit = -1;
}
// Make sure you're not teetering when you shouldn't be.
if (player->panim == PA_EDGE
&& (player->mo->momx || player->mo->momy || player->mo->momz))