Remove cl_ddrace_scoreboard and cl_demo_assume_race settings

Time score will now always be used for any game with the flag `GAMEINFOFLAG_TIMESCORE` set in the `CNetObj_GameInfoEx` object. If the flag is not set, points score is used instead.

Backwards compatibility for old demos, that were recorded without this net object and flag, is removed. For old demos, points score is always assumed now.

Closes #6700.
This commit is contained in:
Robert Müller 2024-05-20 10:57:24 +02:00
parent 08a8680a8e
commit 7da8308c3f
6 changed files with 5 additions and 12 deletions

View file

@ -3588,10 +3588,6 @@ const char *CClient::DemoPlayer_Play(const char *pFilename, int StorageType)
str_copy(m_CurrentServerInfo.m_aMap, pMapInfo->m_aName);
m_CurrentServerInfo.m_MapCrc = pMapInfo->m_Crc;
m_CurrentServerInfo.m_MapSize = pMapInfo->m_Size;
if(g_Config.m_ClDemoAssumeRace)
{
str_copy(m_CurrentServerInfo.m_aGameType, "DDraceNetwork");
}
GameClient()->OnConnected();

View file

@ -719,7 +719,7 @@ void CServerBrowser::SetInfo(CServerEntry *pEntry, const CServerInfo &Info) cons
if(pEntry->m_Info.m_ClientScoreKind == CServerInfo::CLIENT_SCORE_KIND_UNSPECIFIED)
{
if((str_find_nocase(pEntry->m_Info.m_aGameType, "race") || str_find_nocase(pEntry->m_Info.m_aGameType, "fastcap")) && g_Config.m_ClDDRaceScoreBoard)
if(str_find_nocase(pEntry->m_Info.m_aGameType, "race") || str_find_nocase(pEntry->m_Info.m_aGameType, "fastcap"))
{
pEntry->m_Info.m_ClientScoreKind = CServerInfo::CLIENT_SCORE_KIND_TIME_BACKCOMPAT;
}

View file

@ -540,7 +540,6 @@ MACRO_CONFIG_INT(ClReplays, cl_replays, 0, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE,
MACRO_CONFIG_INT(ClReplayLength, cl_replay_length, 30, 10, 0, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Set the default length of the replays")
MACRO_CONFIG_INT(ClRaceRecordServerControl, cl_race_record_server_control, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Let the server start the race recorder")
MACRO_CONFIG_INT(ClDemoName, cl_demo_name, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Save the player name within the demo")
MACRO_CONFIG_INT(ClDemoAssumeRace, cl_demo_assume_race, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Assume that demos are race demos")
MACRO_CONFIG_INT(ClRaceGhost, cl_race_ghost, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Enable ghost")
MACRO_CONFIG_INT(ClRaceGhostServerControl, cl_race_ghost_server_control, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Let the server start the ghost")
MACRO_CONFIG_INT(ClRaceShowGhost, cl_race_show_ghost, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show ghost")
@ -549,7 +548,6 @@ MACRO_CONFIG_INT(ClRaceGhostStrictMap, cl_race_ghost_strict_map, 0, 0, 1, CFGFLA
MACRO_CONFIG_INT(ClRaceGhostSaveBest, cl_race_ghost_save_best, 1, 0, 1, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Save only ghosts that are better than the previous record.")
MACRO_CONFIG_INT(ClRaceGhostAlpha, cl_race_ghost_alpha, 40, 0, 100, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Visbility of ghosts (alpha value, 0 invisible, 100 fully visible)")
MACRO_CONFIG_INT(ClDDRaceScoreBoard, cl_ddrace_scoreboard, 1, 0, 1, CFGFLAG_SAVE | CFGFLAG_CLIENT, "Enable DDRace Scoreboard")
MACRO_CONFIG_INT(SvResetPickups, sv_reset_pickups, 0, 0, 1, CFGFLAG_SERVER | CFGFLAG_GAME, "Whether the weapons are reset on passing the start tile or not")
MACRO_CONFIG_INT(ClShowOthers, cl_show_others, 0, 0, 2, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show players in other teams (2 to show own team only)")
MACRO_CONFIG_INT(ClShowOthersAlpha, cl_show_others_alpha, 40, 0, 100, CFGFLAG_CLIENT | CFGFLAG_SAVE, "Show players in other teams (alpha value, 0 invisible, 100 fully visible)")

View file

@ -316,7 +316,7 @@ void CHud::RenderScoreHud()
{
if(apPlayerInfo[t])
{
if(m_pClient->m_GameInfo.m_TimeScore && g_Config.m_ClDDRaceScoreBoard)
if(m_pClient->m_GameInfo.m_TimeScore)
{
if(apPlayerInfo[t]->m_Score != -9999)
str_time((int64_t)absolute(apPlayerInfo[t]->m_Score) * 100, TIME_HOURS, aScore[t], sizeof(aScore[t]));

View file

@ -2556,7 +2556,6 @@ void CMenus::RenderSettingsAppearance(CUIRect MainView)
RightView.HSplitTop(MarginSmall, nullptr, &RightView);
// Switches of various DDRace HUD elements
DoButton_CheckBoxAutoVMarginAndSet(&g_Config.m_ClDDRaceScoreBoard, Localize("Use DDRace Scoreboard"), &g_Config.m_ClDDRaceScoreBoard, &RightView, LineSize);
DoButton_CheckBoxAutoVMarginAndSet(&g_Config.m_ClShowIds, Localize("Show client IDs in scoreboard"), &g_Config.m_ClShowIds, &RightView, LineSize);
DoButton_CheckBoxAutoVMarginAndSet(&g_Config.m_ClShowhudDDRace, Localize("Show DDRace HUD"), &g_Config.m_ClShowhudDDRace, &RightView, LineSize);
if(g_Config.m_ClShowhudDDRace)

View file

@ -220,7 +220,7 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
}
}
if(m_pClient->m_GameInfo.m_TimeScore && g_Config.m_ClDDRaceScoreBoard)
if(m_pClient->m_GameInfo.m_TimeScore)
{
if(m_ServerRecord > 0)
str_time_float(m_ServerRecord, TIME_HOURS, aBuf, sizeof(aBuf));
@ -289,7 +289,7 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
x += 10.0f;
y += 50.0f;
float HeadlineFontsize = 22.0f;
const char *pScore = (m_pClient->m_GameInfo.m_TimeScore && g_Config.m_ClDDRaceScoreBoard) ? Localize("Time") : Localize("Score");
const char *pScore = m_pClient->m_GameInfo.m_TimeScore ? Localize("Time") : Localize("Score");
tw = TextRender()->TextWidth(HeadlineFontsize, pScore, -1, -1.0f);
TextRender()->Text(ScoreOffset + ScoreLength - tw, y + (HeadlineFontsize * 2.f - HeadlineFontsize) / 2.f, HeadlineFontsize, pScore, -1.0f);
@ -397,7 +397,7 @@ void CScoreboard::RenderScoreboard(float x, float y, float w, int Team, const ch
}
// score
if(m_pClient->m_GameInfo.m_TimeScore && g_Config.m_ClDDRaceScoreBoard)
if(m_pClient->m_GameInfo.m_TimeScore)
{
if(pInfo->m_Score == -9999)
aBuf[0] = 0;