From 2523f71c15edab31fba6822e664ba700039d5ac8 Mon Sep 17 00:00:00 2001
From: Morosophos <morosophos@teichisma.info>
Date: Fri, 4 Sep 2020 21:44:43 +0300
Subject: [PATCH] Add `maplist rebuild` command

---
 qcsrc/common/command/generic.qc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/qcsrc/common/command/generic.qc b/qcsrc/common/command/generic.qc
index 7ef5cb64e5..00020a48d9 100644
--- a/qcsrc/common/command/generic.qc
+++ b/qcsrc/common/command/generic.qc
@@ -270,6 +270,12 @@ void GenericCommand_maplist(int request, int argc)
 					return;
 				}
 
+                        case "rebuild": // rebuilds maplist to include available maps, useful after doing fs_rescan
+                          {
+                            cvar_set("g_maplist", MapInfo_ListAllowedMaps(MapInfo_CurrentGametype(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags()));
+                            return;
+                          }
+
 				case "remove": // scans maplist and only adds back whatever maps were not provided in argv(2)
 				{
 					if(argc == 3)
-- 
2.39.5