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

This commit is contained in:
Antonio Martinez 2025-08-07 21:59:42 -04:00
parent 0918e83873
commit 015e2f0930
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;
@ -467,10 +470,13 @@ boolean M_Responder(event_t *ev)
{
// Quick Retry (Z in modeattacking)
if (modeattacking && G_PlayerInputDown(0, gc_vote, splitscreen + 1) == true)
{
if (!blockreset)
{
M_TryAgain(0);
return true;
}
}
// Quick Spectate (L+R+A+Start online)
if (G_GametypeHasSpectators())

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();