From 5235408b0eec1f0658c5b3f83a7dd518528b9c5e Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Tue, 17 Oct 2023 21:31:20 -0700 Subject: [PATCH] Update respawn waypoint on fastfall bounce --- src/d_player.h | 2 +- src/k_kart.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/d_player.h b/src/d_player.h index 57b33bcf4..7a42351cb 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -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. diff --git a/src/k_kart.c b/src/k_kart.c index b65553acc..af38c6f82 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -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;