Skip to content

Commit 4b39fff

Browse files
committed
spectator slots won't be automatically set by default anymore
1 parent acd82c0 commit 4b39fff

3 files changed

Lines changed: 13 additions & 5 deletions

File tree

src/engine/shared/config_variables.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,7 @@ MACRO_CONFIG_INT(SvKoBo3, sv_ko_bo3, 0, 0, 5, CFGFLAG_SERVER, "Best of X wins (K
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")
665+
MACRO_CONFIG_INT(SvKoSetSlots, sv_ko_set_slots, 0, 0, 1, CFGFLAG_SERVER, "If slots are automatically set & unset by server")
665666

666667

667668
MACRO_CONFIG_STR(SvRoundStatsDiscordWebhooks, sv_round_stats_discord_webhooks, 512, "", CFGFLAG_SERVER, "If set will post score stats there on round end. Is JSON")

src/game/server/ddracecommands.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ void CGameContext::ConKO_Start(IConsole::IResult *pResult, void *pUserData)
114114
return;
115115
}
116116

117-
g_Config.m_SvSpectatorSlots = g_Config.m_SvMaxClients - playerCount;
117+
if(g_Config.m_SvKoSetSlots)
118+
g_Config.m_SvSpectatorSlots = g_Config.m_SvMaxClients - playerCount;
118119
}
119120

120121
for(int i = 0; i < MAX_CLIENTS; i++)

src/game/server/gamemodes/DDRace.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,13 @@ void CGameControllerDDRace::KO_Start()
9292
else
9393
{
9494
SendWebhook();
95-
g_Config.m_SvSpectatorSlots = 0;
95+
96+
if(g_Config.m_SvKoSetSlots)
97+
g_Config.m_SvSpectatorSlots = 0;
9698
}
9799
GameServer()->ko_game = false;
98100
GameServer()->ko_round = 0;
101+
GameServer()->ko_player_count = 0;
99102
return;
100103
}
101104

@@ -150,7 +153,9 @@ void CGameControllerDDRace::KO_Start()
150153
GameServer()->ko_game = false;
151154
GameServer()->ko_round = 0;
152155
GameServer()->ko_player_count = 0;
153-
g_Config.m_SvSpectatorSlots = 0;
156+
157+
if(g_Config.m_SvKoSetSlots)
158+
g_Config.m_SvSpectatorSlots = 0;
154159
SendWebhook();
155160
return;
156161
}
@@ -505,7 +510,8 @@ void CGameControllerDDRace::HandleCharacterTiles(CCharacter *pChr, int MapIndex)
505510
SaveCOTD();
506511
else
507512
{
508-
g_Config.m_SvSpectatorSlots = 0;
513+
if(g_Config.m_SvKoSetSlots)
514+
g_Config.m_SvSpectatorSlots = 0;
509515
SendWebhook();
510516
}
511517

@@ -635,7 +641,7 @@ void CGameControllerDDRace::Tick()
635641
if(players == 0)
636642
{
637643
//no players so stop the game
638-
if(g_Config.m_SvKoBo3)
644+
if(g_Config.m_SvKoBo3 && g_Config.m_SvKoSetSlots)
639645
g_Config.m_SvSpectatorSlots = 0;
640646

641647
GameServer()->ko_game = false;

0 commit comments

Comments
 (0)