diff --git a/src/d_player.h b/src/d_player.h index 8eba8f205..f78a07e38 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -104,8 +104,9 @@ typedef enum PF_RINGLOCK = 1<<13, // Prevent picking up rings while SPB is locked on PF_ANALOGSTICK = 1<<14, // This player is using an analog joystick + PF_TRUSTWAYPOINTS = 1<<15, // Do not activate lap cheat prevention next time finish line distance is updated - //15-17 free, was previously itemflags stuff + //16-17 free, was previously itemflags stuff PF_DRIFTINPUT = 1<<18, // Drifting! PF_GETSPARKS = 1<<19, // Can get sparks diff --git a/src/deh_tables.c b/src/deh_tables.c index 7a80db60b..5bd5700f9 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -4016,7 +4016,7 @@ const char *const PLAYERFLAG_LIST[] = { "RINGLOCK", // Prevent picking up rings while SPB is locked on "ANALOGSTICK", // This player is using an analog joystick - "\x01", // Free + "TRUSTWAYPOINTS", // Do not activate lap cheat prevention next time finish line distance is updated "\x01", // Free "\x01", // Free diff --git a/src/k_kart.c b/src/k_kart.c index cb8ea9f0c..abfcbd203 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -9987,10 +9987,11 @@ static void K_UpdatePlayerWaypoints(player_t *const player) player->distancetofinishprev = player->distancetofinish; K_UpdateDistanceFromFinishLine(player); - // Respawning should be a full reset. - // So should touching the first waypoint ever. UINT32 delta = u32_delta(player->distancetofinish, player->distancetofinishprev); - if (player->respawn.state == RESPAWNST_NONE && delta > distance_threshold && old_currentwaypoint != NULL) + if (delta > distance_threshold && + player->respawn.state == RESPAWNST_NONE && // Respawning should be a full reset. + old_currentwaypoint != NULL && // So should touching the first waypoint ever. + !(player->pflags & PF_TRUSTWAYPOINTS)) // Special exception. { extern consvar_t cv_debuglapcheat; #define debug_args "Player %s: waypoint ID %d too far away (%u > %u)\n", \ @@ -10036,6 +10037,8 @@ static void K_UpdatePlayerWaypoints(player_t *const player) player->lastsafelap = player->laps; player->lastsafecheatcheck = player->cheatchecknum; } + + player->pflags &= ~PF_TRUSTWAYPOINTS; // clear special exception } INT32 K_GetKartRingPower(const player_t *player, boolean boosted)