From 3c63b842999fd68acf7c76d0a9a303163560a39a Mon Sep 17 00:00:00 2001 From: Eidolon Date: Sat, 24 Feb 2024 17:38:28 -0600 Subject: [PATCH 1/2] Skip titlecard for modeattacking except VERSUS Fixes KartKrew/Kart#1062 --- src/g_game.c | 24 +++++++++--------------- src/g_game.h | 4 +--- src/menus/transient/pause-game.c | 5 +---- src/p_setup.cpp | 11 +++-------- 4 files changed, 14 insertions(+), 30 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 4cd1a7f8d..5ee9813c8 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -212,7 +212,6 @@ unloaded_cupheader_t *unloadedcupheaders = NULL; static boolean exitgame = false; static boolean retrying = false; -static boolean retryingmodeattack = false; UINT8 stagefailed; // Used for GEMS BONUS? Also to see if you beat the stage. @@ -1315,6 +1314,12 @@ boolean G_IsTitleCardAvailable(void) if (K_PodiumSequence() == true) return false; + // Mynd you, møøse bites Kan be pretty nasti... + if (modeattacking != ATTACKING_NONE && gametype != GT_VERSUS) + { + return false; + } + // The title card is available. return true; } @@ -1455,7 +1460,7 @@ boolean G_Responder(event_t *ev) pausedelay = 1+(NEWTICRATE/2); else if (++pausedelay > 1+(NEWTICRATE/2)+(NEWTICRATE/3)) { - G_SetModeAttackRetryFlag(); + G_SetRetryFlag(); return true; } pausedelay++; // counteract subsequent subtraction this frame @@ -5427,20 +5432,9 @@ boolean G_GetRetryFlag(void) return retrying; } -void G_SetModeAttackRetryFlag(void) +boolean G_IsModeAttackRetrying(void) { - retryingmodeattack = true; - G_SetRetryFlag(); -} - -void G_ClearModeAttackRetryFlag(void) -{ - retryingmodeattack = false; -} - -boolean G_GetModeAttackRetryFlag(void) -{ - return retryingmodeattack; + return retrying && modeattacking != ATTACKING_NONE; } // Time utility functions diff --git a/src/g_game.h b/src/g_game.h index 785db0b57..8d3ea37b8 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -250,9 +250,7 @@ void G_SetRetryFlag(void); void G_ClearRetryFlag(void); boolean G_GetRetryFlag(void); -void G_SetModeAttackRetryFlag(void); -void G_ClearModeAttackRetryFlag(void); -boolean G_GetModeAttackRetryFlag(void); +boolean G_IsModeAttackRetrying(void); void G_LoadGameData(void); void G_LoadGameSettings(void); diff --git a/src/menus/transient/pause-game.c b/src/menus/transient/pause-game.c index a04f3353c..7991b4ab1 100644 --- a/src/menus/transient/pause-game.c +++ b/src/menus/transient/pause-game.c @@ -429,10 +429,7 @@ void M_TryAgain(INT32 choice) G_CheckDemoStatus(); // Cancel recording M_StartTimeAttack(-1); } - else - { - G_SetRetryFlag(); - } + G_SetRetryFlag(); } static void M_GiveUpResponse(INT32 ch) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 9e9e46998..3f89a31fd 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -8363,14 +8363,10 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate) // Special stage & record attack retry fade to white // This is handled BEFORE sounds are stopped. - if (G_GetModeAttackRetryFlag()) + if (G_IsModeAttackRetrying() && !demo.playback && gametype != GT_VERSUS) { - if (modeattacking && !demo.playback) - { - ranspecialwipe = 2; - //wipestyleflags |= (WSF_FADEOUT|WSF_TOWHITE); - } - G_ClearModeAttackRetryFlag(); + ranspecialwipe = 2; + //wipestyleflags |= (WSF_FADEOUT|WSF_TOWHITE); } // Make sure all sounds are stopped before Z_FreeTags. @@ -8410,7 +8406,6 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate) if (ranspecialwipe == 2) { pausedelay = -3; // preticker plus one - S_StartSound(NULL, sfx_s3k73); } // We should be fine starting music here. From 217f19158fed3fd060021301bb725e2644a0c0b4 Mon Sep 17 00:00:00 2001 From: Eidolon Date: Sat, 24 Feb 2024 18:07:57 -0600 Subject: [PATCH 2/2] Play and don't reset nonsynced level music in TA Fixes KartKrew/Kart#1064 --- src/p_setup.cpp | 2 +- src/p_tick.c | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 3f89a31fd..a147e836c 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -8210,7 +8210,7 @@ void P_LoadLevelMusic(void) { const char *music = mapheaderinfo[gamemap-1]->musname[mapmusrng]; - if (gametyperules & GTR_NOPOSITION) + if (gametyperules & GTR_NOPOSITION || modeattacking != ATTACKING_NONE) { if (!stricmp(Music_Song("level_nosync"), music)) { diff --git a/src/p_tick.c b/src/p_tick.c index 864971471..2815f16b7 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -1039,7 +1039,18 @@ void P_Ticker(boolean run) } // POSITION!! music - P_StartPositionMusic(true); // exact times only + if (modeattacking == ATTACKING_NONE) + { + P_StartPositionMusic(true); // exact times only + } + } + } + + if (modeattacking != ATTACKING_NONE) + { + if (leveltime == 4 && !Music_Playing("level_nosync")) + { + Music_Play("level_nosync"); } }