mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 02:18:26 +00:00
clean some random tiers usage stuff in shavit-mapchooser
This commit is contained in:
parent
fda64ad102
commit
d6aaa8e413
@ -627,7 +627,7 @@ void InitiateMapVote(MapChange when)
|
||||
char map[PLATFORM_MAX_PATH];
|
||||
char mapdisplay[PLATFORM_MAX_PATH + 32];
|
||||
|
||||
StringMap tiersMap = gB_Rankings ? Shavit_GetMapTiers() : new StringMap();
|
||||
StringMap tiersMap = gB_Rankings ? Shavit_GetMapTiers() : null;
|
||||
|
||||
int nominateMapsToAdd = (mapsToAdd > g_aNominateList.Length) ? g_aNominateList.Length : mapsToAdd;
|
||||
for(int i = 0; i < nominateMapsToAdd; i++)
|
||||
@ -635,7 +635,7 @@ void InitiateMapVote(MapChange when)
|
||||
g_aNominateList.GetString(i, map, sizeof(map));
|
||||
GetMapDisplayName(map, mapdisplay, sizeof(mapdisplay));
|
||||
|
||||
if(g_cvMapVoteShowTier.BoolValue)
|
||||
if (tiersMap && g_cvMapVoteShowTier.BoolValue)
|
||||
{
|
||||
int tier = 0;
|
||||
tiersMap.GetValue(mapdisplay, tier);
|
||||
@ -691,7 +691,7 @@ void InitiateMapVote(MapChange when)
|
||||
continue;
|
||||
}
|
||||
|
||||
if(g_cvMapVoteShowTier.BoolValue)
|
||||
if (tiersMap && g_cvMapVoteShowTier.BoolValue)
|
||||
{
|
||||
int tier = 0;
|
||||
tiersMap.GetValue(mapdisplay, tier);
|
||||
@ -1193,7 +1193,9 @@ 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 ? Shavit_GetMapTiers() : new StringMap();
|
||||
StringMap tiersMap = gB_Rankings ? Shavit_GetMapTiers() : null;
|
||||
int min = GetConVarInt(g_cvMinTier);
|
||||
int max = GetConVarInt(g_cvMaxTier);
|
||||
|
||||
int length = g_aMapList.Length;
|
||||
for(int i = 0; i < length; i++)
|
||||
@ -1221,13 +1223,20 @@ void SMC_NominateMatches(int client, const char[] mapname)
|
||||
char mapdisplay[PLATFORM_MAX_PATH];
|
||||
LessStupidGetMapDisplayName(entry, mapdisplay, sizeof(mapdisplay));
|
||||
|
||||
int tier = 0;
|
||||
tiersMap.GetValue(mapdisplay, tier);
|
||||
if (tiersMap)
|
||||
{
|
||||
int tier = 0;
|
||||
tiersMap.GetValue(mapdisplay, tier);
|
||||
|
||||
char mapdisplay2[PLATFORM_MAX_PATH];
|
||||
FormatEx(mapdisplay2, sizeof(mapdisplay2), "%s | T%i", mapdisplay, tier);
|
||||
if (!(min <= tier <= max))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
subNominateMenu.AddItem(entry, mapdisplay2);
|
||||
Format(mapdisplay, sizeof(mapdisplay), "%s | T%i", mapdisplay, tier);
|
||||
}
|
||||
|
||||
subNominateMenu.AddItem(entry, mapdisplay);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1472,7 +1481,7 @@ void CreateNominateMenu()
|
||||
g_hNominateMenu = new Menu(NominateMenuHandler);
|
||||
|
||||
g_hNominateMenu.SetTitle("Nominate");
|
||||
StringMap tiersMap = gB_Rankings ? Shavit_GetMapTiers() : new StringMap();
|
||||
StringMap tiersMap = gB_Rankings ? Shavit_GetMapTiers() : null;
|
||||
|
||||
g_aMapList.SortCustom(SlowSortThatSkipsFolders);
|
||||
|
||||
@ -1497,7 +1506,7 @@ void CreateNominateMenu()
|
||||
char mapdisplay[PLATFORM_MAX_PATH];
|
||||
LessStupidGetMapDisplayName(mapname, mapdisplay, sizeof(mapdisplay));
|
||||
|
||||
if (gB_Rankings)
|
||||
if (tiersMap)
|
||||
{
|
||||
int tier = 0;
|
||||
tiersMap.GetValue(mapdisplay, tier);
|
||||
@ -1554,7 +1563,7 @@ void CreateTierMenus()
|
||||
int max = GetConVarInt(g_cvMaxTier);
|
||||
|
||||
InitTierMenus(min,max);
|
||||
StringMap tiersMap = gB_Rankings ? Shavit_GetMapTiers() : new StringMap();
|
||||
StringMap tiersMap = gB_Rankings ? Shavit_GetMapTiers() : null;
|
||||
|
||||
int length = g_aMapList.Length;
|
||||
for(int i = 0; i < length; ++i)
|
||||
@ -1567,7 +1576,11 @@ void CreateTierMenus()
|
||||
LessStupidGetMapDisplayName(mapname, mapdisplay, sizeof(mapdisplay));
|
||||
|
||||
int mapTier = 0;
|
||||
tiersMap.GetValue(mapdisplay, mapTier);
|
||||
|
||||
if (tiersMap)
|
||||
{
|
||||
tiersMap.GetValue(mapdisplay, mapTier);
|
||||
}
|
||||
|
||||
if(StrEqual(mapname, g_cMapName))
|
||||
{
|
||||
@ -1580,12 +1593,11 @@ void CreateTierMenus()
|
||||
style = ITEMDRAW_DISABLED;
|
||||
}
|
||||
|
||||
char mapdisplay2[PLATFORM_MAX_PATH];
|
||||
FormatEx(mapdisplay2, sizeof(mapdisplay2), "%s | T%i", mapdisplay, mapTier);
|
||||
Format(mapdisplay, sizeof(mapdisplay), "%s | T%i", mapdisplay, mapTier);
|
||||
|
||||
if (min <= mapTier <= max)
|
||||
{
|
||||
AddMenuItem(g_aTierMenus[mapTier], mapname, mapdisplay2, style);
|
||||
AddMenuItem(g_aTierMenus[mapTier], mapname, mapdisplay, style);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1997,7 +2009,7 @@ public Action BaseCommands_Command_Map_Menu(int client, int args)
|
||||
char map[PLATFORM_MAX_PATH];
|
||||
Menu menu = new Menu(MapsMenuHandler);
|
||||
|
||||
StringMap tiersMap = gB_Rankings ? Shavit_GetMapTiers() : new StringMap();
|
||||
StringMap tiersMap = gB_Rankings ? Shavit_GetMapTiers() : null;
|
||||
ArrayList maps;
|
||||
|
||||
if (args < 1)
|
||||
@ -2029,13 +2041,14 @@ public Action BaseCommands_Command_Map_Menu(int client, int args)
|
||||
char mapdisplay[PLATFORM_MAX_PATH];
|
||||
LessStupidGetMapDisplayName(entry, mapdisplay, sizeof(mapdisplay));
|
||||
|
||||
int tier = 0;
|
||||
tiersMap.GetValue(mapdisplay, tier);
|
||||
if (tiersMap)
|
||||
{
|
||||
int tier = 0;
|
||||
tiersMap.GetValue(mapdisplay, tier);
|
||||
Format(mapdisplay, sizeof(mapdisplay), "%s | T%i", mapdisplay, tier);
|
||||
}
|
||||
|
||||
char mapdisplay2[PLATFORM_MAX_PATH];
|
||||
FormatEx(mapdisplay2, sizeof(mapdisplay2), "%s | T%i", mapdisplay, tier);
|
||||
|
||||
menu.AddItem(entry, mapdisplay2);
|
||||
menu.AddItem(entry, mapdisplay);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user