|
154 | 154 | MapListFolder,
|
155 | 155 | MapListMixed,
|
156 | 156 | MapListZonedMixedWithFolder,
|
| 157 | + MapListLAST, |
157 | 158 | }
|
158 | 159 |
|
159 | 160 | public Plugin myinfo =
|
@@ -199,7 +200,7 @@ public void OnPluginStart()
|
199 | 200 |
|
200 | 201 | g_mMapList = new StringMap();
|
201 | 202 |
|
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); |
203 | 204 | 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);
|
204 | 205 | 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);
|
205 | 206 | 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)
|
689 | 690 | char map[PLATFORM_MAX_PATH];
|
690 | 691 | char mapdisplay[PLATFORM_MAX_PATH + 32];
|
691 | 692 |
|
692 |
| - StringMap tiersMap = (gB_Rankings && gI_Driver == Driver_mysql) ? Shavit_GetMapTiers() : null; |
| 693 | + StringMap tiersMap = null; |
| 694 | + if (gB_Rankings) tiersMap = Shavit_GetMapTiers(); |
693 | 695 |
|
694 | 696 | int nominateMapsToAdd = (mapsToAdd > g_aNominateList.Length) ? g_aNominateList.Length : mapsToAdd;
|
695 | 697 | for(int i = 0; i < nominateMapsToAdd; i++)
|
@@ -1290,7 +1292,8 @@ void SMC_NominateMatches(int client, const char[] mapname)
|
1290 | 1292 | bool isOldMap = false;
|
1291 | 1293 | char map[PLATFORM_MAX_PATH];
|
1292 | 1294 | 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(); |
1294 | 1297 | int min = GetConVarInt(g_cvMinTier);
|
1295 | 1298 | int max = GetConVarInt(g_cvMaxTier);
|
1296 | 1299 |
|
@@ -1579,7 +1582,8 @@ void CreateNominateMenu()
|
1579 | 1582 | g_hNominateMenu = new Menu(NominateMenuHandler);
|
1580 | 1583 |
|
1581 | 1584 | 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(); |
1583 | 1587 |
|
1584 | 1588 | g_aMapList.SortCustom(SlowSortThatSkipsFolders);
|
1585 | 1589 |
|
@@ -1661,7 +1665,8 @@ void CreateTierMenus()
|
1661 | 1665 | int max = GetConVarInt(g_cvMaxTier);
|
1662 | 1666 |
|
1663 | 1667 | 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(); |
1665 | 1670 |
|
1666 | 1671 | int length = g_aMapList.Length;
|
1667 | 1672 | for(int i = 0; i < length; ++i)
|
@@ -2110,7 +2115,8 @@ public Action BaseCommands_Command_Map_Menu(int client, int args)
|
2110 | 2115 | char map[PLATFORM_MAX_PATH];
|
2111 | 2116 | Menu menu = new Menu(MapsMenuHandler);
|
2112 | 2117 |
|
2113 |
| - StringMap tiersMap = (gB_Rankings && gI_Driver == Driver_mysql) ? Shavit_GetMapTiers() : null; |
| 2118 | + StringMap tiersMap = null; |
| 2119 | + if (gB_Rankings) tiersMap = Shavit_GetMapTiers(); |
2114 | 2120 | ArrayList maps;
|
2115 | 2121 |
|
2116 | 2122 | if (args < 1)
|
|
0 commit comments