diff --git a/src/deh_tables.c b/src/deh_tables.c index d7f3deeee..49278ee83 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -392,7 +392,7 @@ const char *const GAMETYPERULE_LIST[] = { "\x01", "LIVES", "SPECIALBOTS", - "FREEROAM", + "NOCOUNTDOWN", "ENCORE", NULL }; diff --git a/src/doomstat.h b/src/doomstat.h index 5301c1b8b..fde731033 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -510,7 +510,7 @@ enum GameTypeRules GTR_SPECIALBOTS = 1<<21, // Bot difficulty gets stronger between rounds, and the rival system is enabled. // Misc - GTR_FREEROAM = 1<<22, // Disables Countdown timer and control lock at the start of levels. + GTR_NOCOUNTDOWN = 1<<22, // Disables Countdown timer and control lock at the start of levels. GTR_ENCORE = 1<<23, // Enable Encore mode. // free: to and including 1<<31 diff --git a/src/k_hud.c b/src/k_hud.c index b307a9842..47c12d40f 100644 --- a/src/k_hud.c +++ b/src/k_hud.c @@ -5026,7 +5026,7 @@ void K_drawKartHUD(void) } // Draw the countdowns after everything else. - if (!(gametyperules & GTR_FREEROAM) && starttime != introtime + if (!(gametyperules & GTR_NOCOUNTDOWN) && starttime != introtime && leveltime >= introtime && leveltime < starttime+TICRATE) { diff --git a/src/k_kart.c b/src/k_kart.c index 27dcb174d..d6430ca73 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -111,9 +111,8 @@ void K_TimerInit(void) introtime = (108) + 5; // 108 for rotation, + 5 for white fade starttime = 6*TICRATE + (3*TICRATE/4); - if (gametyperules & GTR_FREEROAM) + if (gametyperules & GTR_NOCOUNTDOWN) { - introtime = 0; starttime = 0; } } @@ -7802,7 +7801,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) K_HandleDelayedHitByEm(player); - if (!(gametyperules & GTR_FREEROAM)) + if (!(gametyperules & GTR_NOCOUNTDOWN)) K_RaceStart(player); // Squishing diff --git a/src/p_tick.c b/src/p_tick.c index 79c7978f8..0640a4dbe 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -775,7 +775,7 @@ void P_Ticker(boolean run) { if (!(titlemapinaction == TITLEMAP_RUNNING)) { - if (!(gametyperules & GTR_FREEROAM)) + if (!(gametyperules & GTR_NOCOUNTDOWN)) { if (leveltime == starttime-(3*TICRATE)) { @@ -791,17 +791,20 @@ void P_Ticker(boolean run) } } - if (!(gametyperules & GTR_FREEROAM) && leveltime < starttime) // SRB2Kart - S_ChangeMusicInternal((encoremode ? "estart" : "kstart"), false); // yes this will be spammed otherwise encore and some stuff WILL overwrite it - else if (leveltime == starttime) // The GO! sound stops the level start ambience - S_StopMusic(); - else if (leveltime == starttime + (TICRATE/2)) // Plays the music after the starting countdown. + // Change timing of start music based on gametyperules { - S_ChangeMusicEx(mapmusname, mapmusflags, true, mapmusposition, 0, 0); - S_ShowMusicCredit(); + tic_t startingtime = (gametyperules & GTR_NOCOUNTDOWN) ? introtime : starttime; + if (leveltime < startingtime) // SRB2Kart + S_ChangeMusicInternal((encoremode ? "estart" : "kstart"), false); // yes this will be spammed otherwise encore and some stuff WILL overwrite it + else if (leveltime == startingtime) // The GO! sound stops the level start ambience + S_StopMusic(); + else if (leveltime == startingtime + (TICRATE/2)) // Plays the music after the starting countdown. + { + S_ChangeMusicEx(mapmusname, mapmusflags, true, mapmusposition, 0, 0); + S_ShowMusicCredit(); + } } } - } ps_lua_thinkframe_time = I_GetPreciseTime(); diff --git a/src/p_user.c b/src/p_user.c index dc9b55e50..1af4784e7 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1994,7 +1994,7 @@ boolean P_CanPlayerTurn(player_t *player, ticcmd_t *cmd) return true; } - if (((gametyperules & GTR_FREEROAM) || (leveltime > starttime)) + if (((gametyperules & GTR_NOCOUNTDOWN) || (leveltime > starttime)) && (cmd->buttons & BT_ACCELERATE) && (cmd->buttons & BT_BRAKE)) { @@ -2063,7 +2063,7 @@ static void P_UpdatePlayerAngle(player_t *player) player->lturn_max[leveltime%MAXPREDICTTICS] = player->rturn_max[leveltime%MAXPREDICTTICS] = 0; } - if ((gametyperules & GTR_FREEROAM) || leveltime >= starttime) + if ((gametyperules & GTR_NOCOUNTDOWN) || leveltime >= starttime) { // KART: Don't directly apply angleturn! It may have been either A) forged by a malicious client, or B) not be a smooth turn due to a player dropping frames. // Instead, turn the player only up to the amount they're supposed to turn accounting for latency. Allow exactly 1 extra turn unit to try to keep old replays synced. @@ -3953,7 +3953,7 @@ void P_PlayerThink(player_t *player) } // SRB2kart 010217 - if (!(gametyperules & GTR_FREEROAM)) + if (!(gametyperules & GTR_NOCOUNTDOWN)) { if (leveltime < starttime) { diff --git a/src/s_sound.c b/src/s_sound.c index 9d0333be8..bf0fee921 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -2612,14 +2612,7 @@ void S_InitLevelMusic(boolean fromnetsave) S_StopMusic(); // Starting ambience should always be restarted, if playing. - if (!(gametyperules & GTR_FREEROAM) && leveltime < (starttime + (TICRATE/2))) // SRB2Kart - { - S_ChangeMusicEx((encoremode ? "estart" : "kstart"), 0, false, mapmusposition, 0, 0); - } - else if (!(gametyperules & GTR_FREEROAM) && leveltime < (starttime + (TICRATE/2))) - { - S_ChangeMusicEx(mapmusname, 0, false, mapmusposition, 0, 0); - } + S_ChangeMusicEx((encoremode ? "estart" : "kstart"), 0, false, mapmusposition, 0, 0); S_ResetMusicStack(); music_stack_noposition = false;