diff --git a/src/d_player.h b/src/d_player.h index caa2ab80d..27767b6cb 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -583,7 +583,6 @@ struct player_t // Respawn UINT8 dropdash; // Gain a burst of speed when you drop while respawning UINT8 respawn; // Timer given when you die. - UINT8 softlocktimer; // Tracks how fast you died after respawning. Use for softlock prevention. UINT16 flashing; UINT16 spinouttimer; // Spin-out from a banana peel or oil slick (was "pw_bananacam") diff --git a/src/g_game.c b/src/g_game.c index 56a8729e9..a86c9c7df 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3150,7 +3150,17 @@ void G_ChangePlayerReferences(mobj_t *oldmo, mobj_t *newmo) void G_DoReborn(INT32 playernum) { player_t *player = &players[playernum]; - boolean starpost = false; + + if (!K_UsingLegacyCheckpoints() && player->lastsafelap != player->laps) + { + // no lap cheating! but more importantly, make sure your lap count matches your respawn point + player->laps = player->lastsafelap; + player->starpostnum = player->lastsafestarpost; + } + + // waypoint maps don't need to force respawning at player starts nearly as often + const boolean sprint = K_UsingLegacyCheckpoints() ? mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE && player->laps > 1 : player->laps > 0; + const boolean starpost = !player->spectator && (sprint || player->starpostnum || (!K_UsingLegacyCheckpoints() && player->starposttime)); // Make sure objectplace is OFF when you first start the level! OP_ResetObjectplace(); @@ -3159,12 +3169,6 @@ void G_DoReborn(INT32 playernum) // respawn at the start mobj_t *oldmo = NULL; - if (player->spectator) - ; - else if ((player->starpostnum || ((player->nextwaypoint != NULL) && player->starposttime)) - || ((mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE) && player->laps)) // SRB2kart - starpost = true; - // first dissasociate the corpse if (player->mo) { diff --git a/src/k_kart.c b/src/k_kart.c index 88a6b3256..83b40a273 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3032,7 +3032,6 @@ static void K_RespawnChecker(player_t *player) player->mo->colorized = false; player->dropdash = 0; player->respawn = 0; - player->softlocktimer = 3*TICRATE; } } } @@ -8213,9 +8212,6 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->checkskip) player->checkskip--; - if (player->softlocktimer) - player->softlocktimer--; - if (player->bigwaypointgap && (player->bigwaypointgap > AUTORESPAWN_THRESHOLD || !P_PlayerInPain(player))) { player->bigwaypointgap--; @@ -10770,12 +10766,6 @@ void K_UpdateAllPlayerPositions(void) continue; } - if (player->respawn > 0 && player->lastsafelap != player->laps) - { - player->laps = player->lastsafelap; - player->starpostnum = player->lastsafestarpost; - } - K_UpdatePlayerWaypoints(player); } } diff --git a/src/p_saveg.c b/src/p_saveg.c index 01c31f0f5..361792abe 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -251,7 +251,6 @@ static void P_NetArchivePlayers(savebuffer_t *save) WRITEUINT8(save->p, players[i].dropdash); WRITEUINT8(save->p, players[i].respawn); - WRITEUINT8(save->p, players[i].softlocktimer); WRITEUINT16(save->p, players[i].flashing); WRITEUINT16(save->p, players[i].spinouttimer); @@ -600,7 +599,6 @@ static void P_NetUnArchivePlayers(savebuffer_t *save) players[i].dropdash = READUINT8(save->p); players[i].respawn = READUINT8(save->p); - players[i].softlocktimer = READUINT8(save->p); players[i].flashing = READUINT16(save->p); players[i].spinouttimer = READUINT16(save->p); diff --git a/src/p_spec.c b/src/p_spec.c index f19f70b8d..6bd2aaa71 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -1994,10 +1994,13 @@ static void K_HandleLapIncrement(player_t *player) player->starposttime = player->realtime; player->starpostnum = 0; - player->lastsafestarpost = 0; player->laps++; - if (mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE) + if (!K_UsingLegacyCheckpoints()) + { + // do nothing, let waypoint code handle respawn positions + } + else if (mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE) { // SRB2Kart 281118 // Save the player's time and position. diff --git a/src/p_user.c b/src/p_user.c index 8b6f272cd..50c530573 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2512,14 +2512,6 @@ static void P_DeathThink(player_t *player) else player->karthud[khud_timeovercam] = 0; - // If the player dies too fast or dies during respawn... - // Set players next respawn point to the next waypoint for extra safety. - if (player->softlocktimer > 0 || player->respawn > 0) - { - // Now a clean function! Neat, eh? - K_SetRespawnAtNextWaypoint(player); - } - K_KartPlayerHUDUpdate(player); if (player->pflags & PF_NOCONTEST)