Merge branch 'lost-time-protection' into 'master'

TA: Prevent reset during tally if time is a new best

See merge request kart-krew-dev/ring-racers-internal!2723
This commit is contained in:
Oni VelocitOni 2025-08-09 03:06:46 +00:00
commit 217316787a
4 changed files with 19 additions and 4 deletions

View file

@ -59,6 +59,9 @@ struct menutransition_s menutransition; // Menu transition properties
INT32 menuKey = -1; // keyboard key pressed for menu
menucmd_t menucmd[MAXSPLITSCREENPLAYERS];
// Prevent early resetting in Attack modes when setting a new best time.
// I can't make demos save at the correct time, but I can do this!
boolean blockreset = false;
// finish wipes between screens
boolean menuwipe = false;
@ -468,8 +471,11 @@ boolean M_Responder(event_t *ev)
// Quick Retry (Z in modeattacking)
if (modeattacking && G_PlayerInputDown(0, gc_vote, splitscreen + 1) == true)
{
M_TryAgain(0);
return true;
if (!blockreset)
{
M_TryAgain(0);
return true;
}
}
// Quick Spectate (L+R+A+Start online)

View file

@ -7618,6 +7618,8 @@ static void P_InitLevelSettings(void)
leveltime = 0;
modulothing = 0;
extern boolean blockreset;
blockreset = 0;
P_SetFreezeLevel(false);
P_SetFreezeCheat(false);

View file

@ -1272,6 +1272,10 @@ void P_DoPlayerExit(player_t *player, pflags_t flags)
player->rings = max(20, player->rings + 20);
}
extern boolean blockreset;
if (modeattacking && !K_IsPlayerLosing(player) && player->realtime < oldbest)
blockreset = true;
const boolean losing = K_IsPlayerLosing(player); // HEY!!!! Set it AFTER K_UpdateAllPlayerPositions!!!!
const boolean specialout = (specialstageinfo.valid == true && losing == true);

View file

@ -2544,6 +2544,9 @@ void Y_StartIntermission(void)
I_Error("endtic is dirty");
#endif
extern boolean blockreset;
blockreset = false;
// set player Power Level type
powertype = K_UsingPowerLevels();