diff --git a/src/k_menufunc.c b/src/k_menufunc.c index 9c0ff5039..0b42743cf 100644 --- a/src/k_menufunc.c +++ b/src/k_menufunc.c @@ -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) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index a200652d2..80388f612 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -7618,6 +7618,8 @@ static void P_InitLevelSettings(void) leveltime = 0; modulothing = 0; + extern boolean blockreset; + blockreset = 0; P_SetFreezeLevel(false); P_SetFreezeCheat(false); diff --git a/src/p_user.c b/src/p_user.c index d542ceaea..168778533 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -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 { diff --git a/src/y_inter.cpp b/src/y_inter.cpp index dae9175a9..7d15a48d8 100644 --- a/src/y_inter.cpp +++ b/src/y_inter.cpp @@ -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();