Skip to content

Commit 08ade55

Browse files
committed
change from best of x to first to x
1 parent 4b39fff commit 08ade55

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

src/engine/shared/config_variables.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ MACRO_CONFIG_STR(SvBannedVersions, sv_banned_versions, 128, "", CFGFLAG_SERVER,
658658
MACRO_CONFIG_INT(SvKoEliminations, sv_ko_eliminations, 1, 1, 20, CFGFLAG_SERVER, "Amount of eliminations per round (KO GAME)")
659659
MACRO_CONFIG_INT(SvKoTimeLimit, sv_ko_time_limit, 20, 1, 99999, CFGFLAG_SERVER, "time limit of 1 round, applies next round (KO GAME)")
660660
MACRO_CONFIG_INT(SvKoPublicChat, sv_ko_public_chat, 0, 0, 1, CFGFLAG_SERVER, "make players able to publicly chat during the game (KO GAME)")
661-
MACRO_CONFIG_INT(SvKoBo3, sv_ko_bo3, 0, 0, 5, CFGFLAG_SERVER, "Best of X wins (KO GAME)")
661+
MACRO_CONFIG_INT(SvKoFirstTo, sv_ko_first_to, 0, 0, 5, CFGFLAG_SERVER, "Activates ko-run mode, first to X wins the game (KO GAME)")
662662
MACRO_CONFIG_INT(SvForcePredictionMargin, sv_force_prediction_margin, 0, 0, 200, CFGFLAG_SERVER, "force players to have a higher prediction margin for more consistant gameplay")
663663
MACRO_CONFIG_INT(SvKoSQL, sv_ko_sql, 0, 0, 1, CFGFLAG_SERVER, "Save result of cup of the day in database")
664664
MACRO_CONFIG_INT(SvKoMode, sv_ko_mode, 0, 0, 1, CFGFLAG_SERVER, "Cup of the day Mode: 0 = gores, 1 = race")

src/game/server/ddracecommands.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ void CGameContext::ConKO_Start(IConsole::IResult *pResult, void *pUserData)
8383

8484
int time = 200;
8585

86-
if(!g_Config.m_SvKoBo3)
86+
if(!g_Config.m_SvKoFirstTo)
8787
{
8888
if(pResult->NumArguments() == 0)
8989
return;

src/game/server/entities/character.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ void CCharacter::Die(int Killer, int Weapon, bool SendKillMsg)
10111011
if(m_pPlayer->m_player_eliminated && GameServer()->ko_game)
10121012
{
10131013
m_pPlayer->m_ko_round = GameServer()->ko_round;
1014-
if(!g_Config.m_SvKoBo3)
1014+
if(!g_Config.m_SvKoFirstTo)
10151015
{
10161016
str_format(aBuf, sizeof(aBuf), "%s is eliminated!", Server()->ClientName(m_Core.m_Id));
10171017
GameServer()->SendBroadcast("You are eliminated!", m_pPlayer->GetCid(), true);

src/game/server/gamemodes/DDRace.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ CGameControllerDDRace::CGameControllerDDRace(class CGameContext *pGameServer) :
2222
{
2323
m_pGameType = g_Config.m_SvTestingCommands ? TEST_TYPE_NAME : GAME_TYPE_NAME;
2424

25-
if(g_Config.m_SvKoBo3)
25+
if(g_Config.m_SvKoFirstTo)
2626
m_pGameType = "KO-Run";
2727
m_GameFlags = protocol7::GAMEFLAG_RACE;
2828
}
@@ -39,7 +39,7 @@ void CGameControllerDDRace::KO_Start()
3939
has_finished = false;
4040
bool finished = (GameServer()->ko_player_count <= 1);
4141

42-
if(GameServer()->ko_round >= g_Config.m_SvKoBo3)
42+
if(GameServer()->ko_round >= g_Config.m_SvKoFirstTo*3)
4343
{
4444
GameServer()->SendChat(-1, TEAM_ALL, "Ran out of rounds");
4545
finished = true;
@@ -64,7 +64,7 @@ void CGameControllerDDRace::KO_Start()
6464
}
6565

6666
char aBuf[256];
67-
if(GameServer()->m_apPlayers[i]->m_player_eliminated && !g_Config.m_SvKoBo3)
67+
if(GameServer()->m_apPlayers[i]->m_player_eliminated && !g_Config.m_SvKoFirstTo)
6868
{
6969
str_format(aBuf, sizeof(aBuf), "you survived until round %i!", GameServer()->m_apPlayers[i]->m_ko_round);
7070
GameServer()->SendChatTarget(i, aBuf);
@@ -73,12 +73,12 @@ void CGameControllerDDRace::KO_Start()
7373

7474
str_format(aBuf, sizeof(aBuf), "%s wins!", Server()->ClientName(i));
7575

76-
if(!g_Config.m_SvKoBo3)
76+
if(!g_Config.m_SvKoFirstTo)
7777
GameServer()->SendBroadcast(aBuf, -1, true);
7878
}
7979
m_Warmup = 10 * Server()->TickSpeed();
8080

81-
if(highestId != -1 && g_Config.m_SvKoBo3)
81+
if(highestId != -1 && g_Config.m_SvKoFirstTo)
8282
{
8383
char aBuf[256];
8484
str_format(aBuf, sizeof(aBuf), "%s wins with %i!", Server()->ClientName(highestId), highestWins);
@@ -87,7 +87,7 @@ void CGameControllerDDRace::KO_Start()
8787
GameServer()->m_apPlayers[highestId]->m_elimination = -2;
8888
}
8989

90-
if(!g_Config.m_SvKoBo3)
90+
if(!g_Config.m_SvKoFirstTo)
9191
SaveCOTD();
9292
else
9393
{
@@ -102,7 +102,7 @@ void CGameControllerDDRace::KO_Start()
102102
return;
103103
}
104104

105-
if(g_Config.m_SvKoBo3)
105+
if(g_Config.m_SvKoFirstTo)
106106
{
107107
int wins = -1;
108108
GameServer()->ko_player_count = 0;
@@ -121,7 +121,7 @@ void CGameControllerDDRace::KO_Start()
121121

122122
wins = GameServer()->m_apPlayers[i]->m_ko_wins;
123123

124-
if(wins >= std::floor(g_Config.m_SvKoBo3 / 2.0)+1)
124+
if(wins >= g_Config.m_SvKoFirstTo)
125125
{
126126
char aBuf[256];
127127
str_format(aBuf, sizeof(aBuf), "%s wins!", Server()->ClientName(i));
@@ -148,7 +148,7 @@ void CGameControllerDDRace::KO_Start()
148148
GameServer()->SendChat(-1, TEAM_ALL, aBuf);
149149
}
150150

151-
if(wins >= std::floor(g_Config.m_SvKoBo3 / 2.0)+1)
151+
if(wins >= g_Config.m_SvKoFirstTo)
152152
{
153153
GameServer()->ko_game = false;
154154
GameServer()->ko_round = 0;
@@ -255,7 +255,7 @@ void CGameControllerDDRace::SendWebhook()
255255
Writer.WriteAttribute("game_type");
256256
char str[50];
257257
str_format(str, sizeof(str), "cotd_bo%i",
258-
g_Config.m_SvKoBo3);
258+
g_Config.m_SvKoFirstTo);
259259
Writer.WriteStrValue(str);
260260

261261
Writer.WriteAttribute("players");
@@ -273,7 +273,7 @@ void CGameControllerDDRace::SendWebhook()
273273
Writer.WriteAttribute("name");
274274
Writer.WriteStrValue(Server()->ClientName(pPlayer->GetCid()));
275275
Writer.WriteAttribute("win");
276-
Writer.WriteIntValue(pPlayer->m_ko_wins == std::floor(g_Config.m_SvKoBo3 / 2.0)+1);
276+
Writer.WriteIntValue(pPlayer->m_ko_wins == g_Config.m_SvKoFirstTo);
277277
Writer.WriteAttribute("rounds");
278278
Writer.WriteIntValue(pPlayer->m_ko_round);
279279
Writer.EndObject();
@@ -465,7 +465,7 @@ void CGameControllerDDRace::HandleCharacterTiles(CCharacter *pChr, int MapIndex)
465465

466466
if(GameServer()->ko_player_count <= 2 && GameServer()->ko_players_finished == 1)
467467
{
468-
if(pPlayer->m_ko_wins < std::floor(g_Config.m_SvKoBo3 / 2.0)+1 && g_Config.m_SvKoBo3)
468+
if(pPlayer->m_ko_wins < g_Config.m_SvKoFirstTo && g_Config.m_SvKoFirstTo)
469469
{
470470
for(int i = 0; i < MAX_CLIENTS; i++)
471471
{
@@ -498,15 +498,15 @@ void CGameControllerDDRace::HandleCharacterTiles(CCharacter *pChr, int MapIndex)
498498
}
499499

500500
GameServer()->m_apPlayers[i]->KillCharacter(WEAPON_WORLD);
501-
if(GameServer()->m_apPlayers[i]->m_player_eliminated && !g_Config.m_SvKoBo3)
501+
if(GameServer()->m_apPlayers[i]->m_player_eliminated && !g_Config.m_SvKoFirstTo)
502502
{
503503
str_format(aBuf, sizeof(aBuf), "you survived until round %i!", GameServer()->m_apPlayers[i]->m_ko_round);
504504
GameServer()->SendChatTarget(i, aBuf);
505505
continue;
506506
}
507507
}
508508

509-
if(!g_Config.m_SvKoBo3)
509+
if(!g_Config.m_SvKoFirstTo)
510510
SaveCOTD();
511511
else
512512
{
@@ -519,7 +519,7 @@ void CGameControllerDDRace::HandleCharacterTiles(CCharacter *pChr, int MapIndex)
519519
GameServer()->ko_player_count = 0;
520520
GameServer()->ko_game = false;
521521
}
522-
}else if(!g_Config.m_SvKoBo3)
522+
}else if(!g_Config.m_SvKoFirstTo)
523523
{
524524
if(GameServer()->ko_player_count-GameServer()->ko_players_tobe_eliminated-GameServer()->ko_players_finished >= 0)
525525
{
@@ -641,7 +641,7 @@ void CGameControllerDDRace::Tick()
641641
if(players == 0)
642642
{
643643
//no players so stop the game
644-
if(g_Config.m_SvKoBo3 && g_Config.m_SvKoSetSlots)
644+
if(g_Config.m_SvKoFirstTo && g_Config.m_SvKoSetSlots)
645645
g_Config.m_SvSpectatorSlots = 0;
646646

647647
GameServer()->ko_game = false;
@@ -668,7 +668,7 @@ void CGameControllerDDRace::Tick()
668668
if(playersIn < 1)
669669
{
670670
m_Warmup = 5 * Server()->TickSpeed();
671-
if(!g_Config.m_SvKoBo3)
671+
if(!g_Config.m_SvKoFirstTo)
672672
m_Warmup = 10 * Server()->TickSpeed();
673673
m_Timer = 1;
674674
}

0 commit comments

Comments
 (0)