From b2c22c1375d34fd57c2fd25f8fd929fce00370a8 Mon Sep 17 00:00:00 2001
From: Mario <mario@smbclan.net>
Date: Sat, 27 Jul 2019 16:55:27 +1000
Subject: [PATCH] Add an option to ignore the player count limits on maps

---
 qcsrc/server/autocvars.qh | 1 +
 qcsrc/server/g_world.qc   | 3 +++
 xonotic-server.cfg        | 1 +
 3 files changed, 5 insertions(+)

diff --git a/qcsrc/server/autocvars.qh b/qcsrc/server/autocvars.qh
index a763b9726..fd5009edc 100644
--- a/qcsrc/server/autocvars.qh
+++ b/qcsrc/server/autocvars.qh
@@ -156,6 +156,7 @@ string autocvar_g_maplist_votable_screenshot_dir;
 bool autocvar_g_maplist_votable_suggestions;
 bool autocvar_g_maplist_votable_suggestions_override_mostrecent;
 float autocvar_g_maplist_votable_timeout;
+bool autocvar_g_maplist_ignore_sizes;
 int autocvar_g_maxplayers;
 float autocvar_g_maxplayers_spectator_blocktime;
 float autocvar_g_maxpushtime;
diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc
index 9ef72ae83..07027875e 100644
--- a/qcsrc/server/g_world.qc
+++ b/qcsrc/server/g_world.qc
@@ -1022,6 +1022,9 @@ bool MapHasRightSize(string map)
 		LOG_TRACE(checkwp_msg, ": has waypoints");
 	}
 
+	if(autocvar_g_maplist_ignore_sizes)
+		return true;
+
 	// open map size restriction file
 	string opensize_msg = strcat("opensize ", map);
 	float fh = fopen(strcat("maps/", map, ".sizes"), FILE_READ);
diff --git a/xonotic-server.cfg b/xonotic-server.cfg
index 463df7224..dadc207b5 100644
--- a/xonotic-server.cfg
+++ b/xonotic-server.cfg
@@ -212,6 +212,7 @@ set g_maplist_index 0	"this is used internally for saving position in maplist cy
 set g_maplist_selectrandom 0	"if 1, a random map will be chosen as next map - DEPRECATED in favor of g_maplist_shuffle"
 set g_maplist_shuffle 1	"new randomization method: like selectrandom, but avoid playing the same maps in short succession. This works by taking out the first element and inserting it into g_maplist with a bias to the end of the list"
 set g_maplist_check_waypoints 0	"when 1, maps are skipped if there currently are bots, but the map has no waypoints"
+set g_maplist_ignore_sizes 0 "when 1, all maps are shown in the map list regardless of player count"
 
 set g_items_mindist 4000 "starting distance for the fading of items"
 set g_items_maxdist 4500 "maximum distance at which an item can be viewed, after which it will be invisible"
-- 
2.39.5