From 4ce5678fd620c3fe2d45f0dac352cf1359fca1c3 Mon Sep 17 00:00:00 2001 From: Benau Date: Mon, 7 Jan 2019 12:41:00 +0800 Subject: [PATCH] Allow team choosing in ownerless server if live players is true --- src/network/protocols/server_lobby.cpp | 3 ++- src/network/server_config.cpp | 3 ++- src/network/server_config.hpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/network/protocols/server_lobby.cpp b/src/network/protocols/server_lobby.cpp index 67d2e015b..b04605583 100644 --- a/src/network/protocols/server_lobby.cpp +++ b/src/network/protocols/server_lobby.cpp @@ -1300,7 +1300,8 @@ void ServerLobby::startSelection(const Event *event) } - if (ServerConfig::m_team_choosing && race_manager->teamEnabled()) + if (!ServerConfig::m_owner_less && ServerConfig::m_team_choosing && + race_manager->teamEnabled()) { auto red_blue = STKHost::get()->getAllPlayersTeamInfo(); if ((red_blue.first == 0 || red_blue.second == 0) && diff --git a/src/network/server_config.cpp b/src/network/server_config.cpp index 412bc079c..e78bf673e 100644 --- a/src/network/server_config.cpp +++ b/src/network/server_config.cpp @@ -314,7 +314,8 @@ void loadServerLobbyFromConfig() { if (m_min_start_game_players > m_server_max_players) m_min_start_game_players = 1; - m_team_choosing = false; + if (!m_live_players) + m_team_choosing = false; m_server_configurable = false; } if (modes.second == RaceManager::MAJOR_MODE_GRAND_PRIX) diff --git a/src/network/server_config.hpp b/src/network/server_config.hpp index 32c01ba78..7e6b64fb9 100644 --- a/src/network/server_config.hpp +++ b/src/network/server_config.hpp @@ -206,7 +206,8 @@ namespace ServerConfig SERVER_CFG_PREFIX BoolServerConfigParam m_team_choosing SERVER_CFG_DEFAULT(BoolServerConfigParam(true, "team-choosing", "Enable team choosing in lobby in team game (soccer and CTF). " - "If owner-less is enabled, than this option is always disabled.")); + "If owner-less is enabled and live-players is not enabled, than this " + "option is always disabled.")); SERVER_CFG_PREFIX BoolServerConfigParam m_strict_players SERVER_CFG_DEFAULT(BoolServerConfigParam(false, "strict-players",