mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-10 19:01:50 +00:00
Add PF_TRUSTWAYPOINTS player flag, disable lap cheat prevention next time finish line distance is calculated
This commit is contained in:
parent
b5f318b405
commit
1015d6964b
3 changed files with 9 additions and 5 deletions
|
|
@ -104,8 +104,9 @@ typedef enum
|
||||||
PF_RINGLOCK = 1<<13, // Prevent picking up rings while SPB is locked on
|
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_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_DRIFTINPUT = 1<<18, // Drifting!
|
||||||
PF_GETSPARKS = 1<<19, // Can get sparks
|
PF_GETSPARKS = 1<<19, // Can get sparks
|
||||||
|
|
|
||||||
|
|
@ -4016,7 +4016,7 @@ const char *const PLAYERFLAG_LIST[] = {
|
||||||
"RINGLOCK", // Prevent picking up rings while SPB is locked on
|
"RINGLOCK", // Prevent picking up rings while SPB is locked on
|
||||||
|
|
||||||
"ANALOGSTICK", // This player is using an analog joystick
|
"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
|
||||||
"\x01", // Free
|
"\x01", // Free
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9987,10 +9987,11 @@ static void K_UpdatePlayerWaypoints(player_t *const player)
|
||||||
player->distancetofinishprev = player->distancetofinish;
|
player->distancetofinishprev = player->distancetofinish;
|
||||||
K_UpdateDistanceFromFinishLine(player);
|
K_UpdateDistanceFromFinishLine(player);
|
||||||
|
|
||||||
// Respawning should be a full reset.
|
|
||||||
// So should touching the first waypoint ever.
|
|
||||||
UINT32 delta = u32_delta(player->distancetofinish, player->distancetofinishprev);
|
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;
|
extern consvar_t cv_debuglapcheat;
|
||||||
#define debug_args "Player %s: waypoint ID %d too far away (%u > %u)\n", \
|
#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->lastsafelap = player->laps;
|
||||||
player->lastsafecheatcheck = player->cheatchecknum;
|
player->lastsafecheatcheck = player->cheatchecknum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
player->pflags &= ~PF_TRUSTWAYPOINTS; // clear special exception
|
||||||
}
|
}
|
||||||
|
|
||||||
INT32 K_GetKartRingPower(const player_t *player, boolean boosted)
|
INT32 K_GetKartRingPower(const player_t *player, boolean boosted)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue