Update respawn waypoint on fastfall bounce

This commit is contained in:
AJ Martinez 2023-10-17 21:31:20 -07:00
parent 63bda6076f
commit 5235408b0e
2 changed files with 9 additions and 1 deletions

View file

@ -67,7 +67,7 @@ typedef enum
{
PF_GODMODE = 1<<0, // Immortal. No lightsnake from pits either
// free: 1<<1
PF_UPDATEMYRESPAWN = 1<<1, // Scripted sequences / fastfall can set this to force a respawn waypoint update
PF_AUTOROULETTE = 1<<2, // Accessibility: Non-deterministic item box, no manual stop.

View file

@ -8953,6 +8953,12 @@ static waypoint_t *K_GetPlayerNextWaypoint(player_t *player)
updaterespawn = false;
}
if (player->pflags & PF_UPDATEMYRESPAWN)
{
updaterespawn = true;
player->pflags &= ~PF_UPDATEMYRESPAWN;
}
// Respawn point should only be updated when we're going to a nextwaypoint
if ((updaterespawn) &&
(player->respawn.state == RESPAWNST_NONE) &&
@ -10688,6 +10694,8 @@ boolean K_FastFallBounce(player_t *player)
if (player->mo->eflags & MFE_UNDERWATER)
bounce = (117 * bounce) / 200;
player->pflags |= PF_UPDATEMYRESPAWN;
player->mo->momz = bounce * P_MobjFlip(player->mo);
player->fastfall = 0;