diff --git a/src/d_player.h b/src/d_player.h index 8f1dd263c..d15dc1d98 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -107,7 +107,7 @@ typedef enum PF_SHRINKME = 1<<28, // "Shrink me" cheat preference PF_SHRINKACTIVE = 1<<29, // "Shrink me" cheat is in effect. (Can't be disabled mid-race) - PF_VOID = 1<<30 + PF_VOID = 1<<30, // Removed from reality! When leaving hitlag, reenable visibility+collision and kill speed. // up to 1<<31 is free } pflags_t; diff --git a/src/k_kart.c b/src/k_kart.c index f1b7ab5b5..081b1b124 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -7803,8 +7803,22 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) player->sneakertimer = 0; player->spindashboost = 0; player->flashing = TICRATE/2; + player->ringboost = 0; + player->driftboost = player->strongdriftboost = 0; + player->gateBoost = 0; } + if (player->pflags & PF_FAULT && player->nocontrol) // Hold player on respawn platform, no fair skipping long POSITION areas + { + if (rainbowstartavailable && ((leveltime <= starttime) || (leveltime - starttime < 10*TICRATE))) + { + player->nocontrol = 50; + player->mo->renderflags |= RF_DONTDRAW; + player->mo->flags |= MF_NOCLIPTHING; + } + } + + if (player->stealingtimer == 0 && player->rocketsneakertimer) player->rocketsneakertimer--; diff --git a/src/k_respawn.c b/src/k_respawn.c index 873d00fd7..4f3ab1020 100644 --- a/src/k_respawn.c +++ b/src/k_respawn.c @@ -119,6 +119,8 @@ void K_DoFault(player_t *player) S_StartSound(player->mo, sfx_s3k83); player->karthud[khud_fault] = 1; player->pflags |= PF_FAULT; + player->mo->renderflags |= RF_DONTDRAW; + player->mo->flags |= MF_NOCLIPTHING; } } @@ -147,7 +149,12 @@ void K_DoIngameRespawn(player_t *player) // FAULT if (leveltime < starttime) + { + if (!(mapheaderinfo[gamemap-1]->levelflags & LF_SECTIONRACE)) + player->respawn.wp = K_GetFinishLineWaypoint()->prevwaypoints[0]; K_DoFault(player); + } + player->ringboost = 0; player->driftboost = player->strongdriftboost = 0; @@ -163,7 +170,7 @@ void K_DoIngameRespawn(player_t *player) player->respawn.pointz += K_RespawnOffset(player, player->respawn.flip); player->respawn.manual = false; // one respawn only! } - else if (player->respawn.wp != NULL && leveltime >= starttime) + else if (player->respawn.wp != NULL) { const UINT32 dist = RESPAWN_DIST + (player->airtime * 48); player->respawn.distanceleft = (dist * mapobjectscale) / FRACUNIT; @@ -272,7 +279,7 @@ void K_DoIngameRespawn(player_t *player) player->respawn.init = true; player->respawn.airtimer = player->airtime; - player->respawn.truedeath = false; + player->respawn.truedeath = player->pflags & PF_FAULT; } /*-------------------------------------------------- @@ -612,6 +619,9 @@ static void K_DropDashWait(player_t *player) if (player->nocontrol == 0) player->respawn.timer--; + if (player->pflags & PF_FAULT) + return; + if (leveltime % 8 == 0) { const UINT8 ns = 8; diff --git a/src/p_spec.c b/src/p_spec.c index 9257bea53..05e81e549 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -1910,16 +1910,19 @@ static void K_HandleLapIncrement(player_t *player) if (leveltime < starttime && !(gametyperules & GTR_ROLLINGSTART)) { // freeze 'em until fault penalty is over - player->mo->hitlag = starttime - leveltime + 50; + player->mo->hitlag = starttime - leveltime + TICRATE*3; player->pflags = PF_VOID; player->mo->renderflags |= RF_DONTDRAW; player->mo->flags |= MF_NOCLIPTHING; - player->nocontrol = 69; - player->hyudorotimer = 69; + player->nocontrol = UINT16_MAX; + player->hyudorotimer = UINT16_MAX; player->speed = 0; K_StripItems(player); player->faulttimer = TICRATE/3; ClearFakePlayerSkin(player); + S_StartSound(player->mo, sfx_s3k8a); + P_MoveOrigin(player->mo, player->mo->old_x, player->mo->old_y, player->mo->z); + return; } if ((player->starpostnum == numstarposts) || (player->laps == 0)) diff --git a/src/p_user.c b/src/p_user.c index f3c7c49c9..e37167386 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4207,7 +4207,11 @@ void P_PlayerThink(player_t *player) if (player->nocontrol && player->nocontrol < UINT16_MAX) { if (!(--player->nocontrol)) + { player->pflags &= ~PF_FAULT; + player->mo->renderflags &= ~RF_DONTDRAW; + player->mo->flags &= ~MF_NOCLIPTHING; + } } else player->nocontrol = 0;