Skip to content

Commit b150073

Browse files
committed
make shavit-mapchooser grab tiers even if not mysql
1 parent ad48aa3 commit b150073

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

addons/sourcemod/scripting/shavit-mapchooser.sp

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ enum
154154
MapListFolder,
155155
MapListMixed,
156156
MapListZonedMixedWithFolder,
157+
MapListLAST,
157158
}
158159

159160
public Plugin myinfo =
@@ -199,7 +200,7 @@ public void OnPluginStart()
199200

200201
g_mMapList = new StringMap();
201202

202-
g_cvMapListType = new Convar("smc_maplist_type", "2", "Where the plugin should get the map list from.\n0 - zoned maps from database\n1 - from maplist file (mapcycle.txt)\n2 - from maps folder\n3 - from zoned maps and confirmed by maplist file\n4 - from zoned maps and confirmed by maps folder", _, true, 0.0, true, 4.0);
203+
g_cvMapListType = new Convar("smc_maplist_type", "2", "Where the plugin should get the map list from.\n0 - zoned maps from database\n1 - from maplist file (mapcycle.txt)\n2 - from maps folder\n3 - from zoned maps and confirmed by maplist file\n4 - from zoned maps and confirmed by maps folder", _, true, 0.0, true, float(MapListLAST)-1.0);
203204
g_cvMatchFuzzyMap = new Convar("smc_match_fuzzy", "1", "If set to 1, the plugin will accept partial map matches from the database. Useful for workshop maps, bad for duplicate map names", _, true, 0.0, true, 1.0);
204205
g_cvHijackMap = new Convar("smc_hijack_sm_map_so_its_faster", "1", "Hijacks sourcemod's built-in sm_map command so it's faster.", 0, true, 0.0, true, 1.0);
205206
g_cvExcludePrefixes = new Convar("smc_exclude_prefixes", "de_,cs_,as_,ar_,dz_,gd_,lobby_,training1,mg_,gg_,jb_,coop_,aim_,awp_,cp_,ctf_,fy_,dm_,hg_,rp_,ze_,zm_,arena_,pl_,plr_,mvm_,db_,trade_,ba_,mge_,ttt_,ph_,hns_,test_,", "Exclude maps based on these prefixes.\nA good reference: https://developer.valvesoftware.com/wiki/Map_prefixes");
@@ -689,7 +690,8 @@ void InitiateMapVote(MapChange when)
689690
char map[PLATFORM_MAX_PATH];
690691
char mapdisplay[PLATFORM_MAX_PATH + 32];
691692

692-
StringMap tiersMap = (gB_Rankings && gI_Driver == Driver_mysql) ? Shavit_GetMapTiers() : null;
693+
StringMap tiersMap = null;
694+
if (gB_Rankings) tiersMap = Shavit_GetMapTiers();
693695

694696
int nominateMapsToAdd = (mapsToAdd > g_aNominateList.Length) ? g_aNominateList.Length : mapsToAdd;
695697
for(int i = 0; i < nominateMapsToAdd; i++)
@@ -1290,7 +1292,8 @@ void SMC_NominateMatches(int client, const char[] mapname)
12901292
bool isOldMap = false;
12911293
char map[PLATFORM_MAX_PATH];
12921294
char oldMapName[PLATFORM_MAX_PATH];
1293-
StringMap tiersMap = (gB_Rankings && gI_Driver == Driver_mysql) ? Shavit_GetMapTiers() : null;
1295+
StringMap tiersMap = null;
1296+
if (gB_Rankings) tiersMap = Shavit_GetMapTiers();
12941297
int min = GetConVarInt(g_cvMinTier);
12951298
int max = GetConVarInt(g_cvMaxTier);
12961299

@@ -1579,7 +1582,8 @@ void CreateNominateMenu()
15791582
g_hNominateMenu = new Menu(NominateMenuHandler);
15801583

15811584
g_hNominateMenu.SetTitle("Nominate");
1582-
StringMap tiersMap = (gB_Rankings && gI_Driver == Driver_mysql) ? Shavit_GetMapTiers() : null;
1585+
StringMap tiersMap = null;
1586+
if (gB_Rankings) tiersMap = Shavit_GetMapTiers();
15831587

15841588
g_aMapList.SortCustom(SlowSortThatSkipsFolders);
15851589

@@ -1661,7 +1665,8 @@ void CreateTierMenus()
16611665
int max = GetConVarInt(g_cvMaxTier);
16621666

16631667
InitTierMenus(min,max);
1664-
StringMap tiersMap = (gB_Rankings && gI_Driver == Driver_mysql) ? Shavit_GetMapTiers() : null;
1668+
StringMap tiersMap = null;
1669+
if (gB_Rankings) tiersMap = Shavit_GetMapTiers();
16651670

16661671
int length = g_aMapList.Length;
16671672
for(int i = 0; i < length; ++i)
@@ -2110,7 +2115,8 @@ public Action BaseCommands_Command_Map_Menu(int client, int args)
21102115
char map[PLATFORM_MAX_PATH];
21112116
Menu menu = new Menu(MapsMenuHandler);
21122117

2113-
StringMap tiersMap = (gB_Rankings && gI_Driver == Driver_mysql) ? Shavit_GetMapTiers() : null;
2118+
StringMap tiersMap = null;
2119+
if (gB_Rankings) tiersMap = Shavit_GetMapTiers();
21142120
ArrayList maps;
21152121

21162122
if (args < 1)

0 commit comments

Comments
 (0)