alias menu_showmonstertools "menu_cmd directmenu MonsterTools"
// command executed before loading a map by the menu
-// makes sure maxplayers is at least minplayers or bot_number + 1
+// makes sure maxplayers is at least minplayers or minplayers_per_team * 4 or bot_number + 1
alias _menu_loadmap_prepare_maxpl "maxplayers $_menu_loadmap_maxplayers"
-alias menu_loadmap_prepare "disconnect; wait; g_campaign 0; menu_cmd rpn /_menu_loadmap_maxplayers menu_maxplayers minplayers bot_number 1 add max max def; _menu_loadmap_prepare_maxpl; g_maplist_shufflenow"
+alias menu_loadmap_prepare "disconnect; wait; g_campaign 0; menu_cmd rpn /_menu_loadmap_maxplayers menu_maxplayers minplayers bot_number 1 add max minplayers_per_team 4 mul max max def; _menu_loadmap_prepare_maxpl; g_maplist_shufflenow"
// ==========================================================
int autocvar_leadlimit_and_fraglimit;
int autocvar_leadlimit_override;
int autocvar_minplayers;
+int autocvar_minplayers_per_team;
string autocvar_nextmap;
string autocvar_quit_and_redirect;
float autocvar_quit_and_redirect_timer;
else if ((realplayers || autocvar_bot_join_empty || (currentbots > 0 && time < 5)))
{
int minplayers = max(0, floor(autocvar_minplayers));
+ if (teamplay)
+ minplayers = max(0, floor(autocvar_minplayers_per_team) * AvailableTeams());
int minbots = max(0, floor(autocvar_bot_number));
// add bots to reach minplayers if needed
{
cvar_settemp("bot_vs_human", "0");
cvar_settemp("minplayers", "0");
+ cvar_settemp("minplayers_per_team", "0");
cvar_settemp("bot_number", "0");
bot_fixcount();
cvar_settemp("bot_number", argv(2));
{
cvar_settemp("bot_vs_human", "0");
cvar_settemp("minplayers", "0");
+ cvar_settemp("minplayers_per_team", "0");
cvar_settemp("bot_number", "0");
bot_fixcount();
cvar_settemp("bot_number", argv(3));
if (argc >= 2)
{
cvar_settemp("minplayers", "0");
+ cvar_settemp("minplayers_per_team", "0");
cvar_settemp("bot_number", argv(1));
bot_fixcount();
return;
BADCVAR("log_file");
BADCVAR("maxplayers");
BADCVAR("minplayers");
+ BADCVAR("minplayers_per_team");
BADCVAR("net_address");
BADCVAR("port");
BADCVAR("rcon_password");
bool MapHasRightSize(string map)
{
- if(currentbots || autocvar_bot_number || player_count < autocvar_minplayers)
- if(autocvar_g_maplist_check_waypoints)
+ int minplayers = max(0, floor(autocvar_minplayers));
+ if (teamplay)
+ minplayers = max(0, floor(autocvar_minplayers_per_team) * AvailableTeams());
+ if (autocvar_g_maplist_check_waypoints
+ && (currentbots || autocvar_bot_number || player_count < minplayers))
{
string checkwp_msg = strcat("checkwp ", map);
if(!fexists(strcat("maps/", map, ".waypoints")))
// server settings
hostname "Xonotic $g_xonoticversion Server"
set sv_mapchange_delay 5
-set minplayers 0 "fill server with bots to reach this number of players (if bot_number is not enough)"
+set minplayers 0 "fill server with bots to reach this number of players in teamless games (if bot_number is not enough)"
+set minplayers_per_team 0 "fill server with bots to reach this number of players per team (if bot_number is not enough)"
// restart server if all players hit "ready"-button
set sv_ready_restart 0 "allow a map to be restarted once all players pressed the \"ready\" button"