diff --git a/src/d_player.h b/src/d_player.h index 4701a019d..dd765bb0b 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -263,6 +263,7 @@ typedef struct respawnvars_s fixed_t pointz; boolean flip; // Flip upside down or not tic_t timer; // Time left on respawn animation once you're there + tic_t airtimer; // Time spent in the air before respawning UINT32 distanceleft; // How far along the course to respawn you tic_t dropdash; // Drop Dash charge timer } respawnvars_t; diff --git a/src/k_respawn.c b/src/k_respawn.c index f09358dcc..2e93a57d8 100644 --- a/src/k_respawn.c +++ b/src/k_respawn.c @@ -276,6 +276,8 @@ void K_DoIngameRespawn(player_t *player) player->respawn.timer = RESPAWN_TIME; player->respawn.state = RESPAWNST_MOVE; + + player->respawn.airtimer = player->airtime; } /*-------------------------------------------------- @@ -318,8 +320,9 @@ size_t K_NextRespawnWaypointIndex(waypoint_t *waypoint) --------------------------------------------------*/ static void K_MovePlayerToRespawnPoint(player_t *player) { - const fixed_t realstepamt = (64 * mapobjectscale); - fixed_t stepamt = realstepamt; + const int airCompensation = 128; + fixed_t realstepamt = (64 * mapobjectscale); + fixed_t stepamt; vector3_t dest, step, laser; angle_t stepha, stepva; @@ -330,6 +333,13 @@ static void K_MovePlayerToRespawnPoint(player_t *player) waypoint_t *laserwp; boolean laserflip; + /* speed up if in the air for a long time */ + realstepamt += FixedMul(realstepamt, + (player->respawn.airtimer * FRACUNIT) + / airCompensation); + + stepamt = realstepamt; + player->mo->momx = player->mo->momy = player->mo->momz = 0; player->flashing = 2; diff --git a/src/p_user.c b/src/p_user.c index 23f67e531..c58e61b4d 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2966,6 +2966,10 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall else lookbackdelay[num]--; } + else if (player->respawn.state != RESPAWNST_NONE) + { + camspeed = 3*FRACUNIT/4; + } lookbackdown = (lookbackdelay[num] == MAXLOOKBACKDELAY) != lookbackactive[num]; lookbackactive[num] = (lookbackdelay[num] == MAXLOOKBACKDELAY); #undef MAXLOOKBACKDELAY @@ -4090,6 +4094,12 @@ DoABarrelRoll (player_t *player) fixed_t smoothing; + if (player->respawn.state != RESPAWNST_NONE) + { + player->tilt = 0; + return; + } + if (player->exiting) { return;