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;
@ -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

@ -1270,7 +1270,11 @@ void P_DoPlayerExit(player_t *player, pflags_t flags)
if (P_IsDisplayPlayer(player))
S_StartSound(NULL, sfx_s3kb0);
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);
@ -3391,7 +3395,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
{
if (r_splitscreen != 1)
camheight = FixedMul(mapheaderinfo[gamemap-1]->cameraHeight, cameraScale);
// For 2p SPLITSCREEN SPECIFICALLY:
// The view is pretty narrow, so move it back 3/20 of the way towards default camera height.
else {

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