Rename freeroam to nocountdown and clean up some relatedcode

Also yes no skipping introtime now
This commit is contained in:
NepDisk 2025-06-29 14:29:06 -04:00
parent 969c161d3f
commit d9bfb3c192
7 changed files with 21 additions and 26 deletions

View file

@ -392,7 +392,7 @@ const char *const GAMETYPERULE_LIST[] = {
"\x01",
"LIVES",
"SPECIALBOTS",
"FREEROAM",
"NOCOUNTDOWN",
"ENCORE",
NULL
};

View file

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

View file

@ -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)
{

View file

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

View file

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

View file

@ -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)
{

View file

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