make shavit-mapchooser grab tiers even if not mysql
Some checks failed
Compile / Build SM ${{ matrix.sm-version }} (1.11) (push) Has been cancelled
Compile / Build SM ${{ matrix.sm-version }} (1.12) (push) Has been cancelled
Compile / Release (push) Has been cancelled

This commit is contained in:
rtldg 2025-02-11 03:52:42 +00:00
parent ad48aa3345
commit b150073754

View File

@ -154,6 +154,7 @@ enum
MapListFolder,
MapListMixed,
MapListZonedMixedWithFolder,
MapListLAST,
}
public Plugin myinfo =
@ -199,7 +200,7 @@ public void OnPluginStart()
g_mMapList = new StringMap();
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);
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);
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);
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);
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)
char map[PLATFORM_MAX_PATH];
char mapdisplay[PLATFORM_MAX_PATH + 32];
StringMap tiersMap = (gB_Rankings && gI_Driver == Driver_mysql) ? Shavit_GetMapTiers() : null;
StringMap tiersMap = null;
if (gB_Rankings) tiersMap = Shavit_GetMapTiers();
int nominateMapsToAdd = (mapsToAdd > g_aNominateList.Length) ? g_aNominateList.Length : mapsToAdd;
for(int i = 0; i < nominateMapsToAdd; i++)
@ -1290,7 +1292,8 @@ void SMC_NominateMatches(int client, const char[] mapname)
bool isOldMap = false;
char map[PLATFORM_MAX_PATH];
char oldMapName[PLATFORM_MAX_PATH];
StringMap tiersMap = (gB_Rankings && gI_Driver == Driver_mysql) ? Shavit_GetMapTiers() : null;
StringMap tiersMap = null;
if (gB_Rankings) tiersMap = Shavit_GetMapTiers();
int min = GetConVarInt(g_cvMinTier);
int max = GetConVarInt(g_cvMaxTier);
@ -1579,7 +1582,8 @@ void CreateNominateMenu()
g_hNominateMenu = new Menu(NominateMenuHandler);
g_hNominateMenu.SetTitle("Nominate");
StringMap tiersMap = (gB_Rankings && gI_Driver == Driver_mysql) ? Shavit_GetMapTiers() : null;
StringMap tiersMap = null;
if (gB_Rankings) tiersMap = Shavit_GetMapTiers();
g_aMapList.SortCustom(SlowSortThatSkipsFolders);
@ -1661,7 +1665,8 @@ void CreateTierMenus()
int max = GetConVarInt(g_cvMaxTier);
InitTierMenus(min,max);
StringMap tiersMap = (gB_Rankings && gI_Driver == Driver_mysql) ? Shavit_GetMapTiers() : null;
StringMap tiersMap = null;
if (gB_Rankings) tiersMap = Shavit_GetMapTiers();
int length = g_aMapList.Length;
for(int i = 0; i < length; ++i)
@ -2110,7 +2115,8 @@ public Action BaseCommands_Command_Map_Menu(int client, int args)
char map[PLATFORM_MAX_PATH];
Menu menu = new Menu(MapsMenuHandler);
StringMap tiersMap = (gB_Rankings && gI_Driver == Driver_mysql) ? Shavit_GetMapTiers() : null;
StringMap tiersMap = null;
if (gB_Rankings) tiersMap = Shavit_GetMapTiers();
ArrayList maps;
if (args < 1)