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