forked from UNLOZE/sm-plugins
removing a bunch of unneeded things and assuring the nomlist wont confuse leader and regular nominations any more when displaying them
This commit is contained in:
@@ -779,6 +779,7 @@ bool PopulateNominateListMenu(Menu menu, int client, const char[] filter = "")
|
||||
}
|
||||
|
||||
StringMap sm = new StringMap();
|
||||
StringMap sm_special_noms = new StringMap(); //storing leaders and admin noms.
|
||||
static char map[PLATFORM_MAX_PATH];
|
||||
static char display[PLATFORM_MAX_PATH];
|
||||
for(int i = 0; i < GetArraySize(MapList); i++)
|
||||
@@ -795,6 +796,7 @@ bool PopulateNominateListMenu(Menu menu, int client, const char[] filter = "")
|
||||
if (!owner || Leader_Is(owner))
|
||||
{
|
||||
nominate_count_for_particular_map = 1999;
|
||||
sm_special_noms.SetValue(map, owner); //admin noms and leaders are unique per each map, so cant be overwritten.
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -825,24 +827,26 @@ bool PopulateNominateListMenu(Menu menu, int client, const char[] filter = "")
|
||||
{
|
||||
int nominate_count_for_particular_map = 0;
|
||||
sm.GetValue(map, nominate_count_for_particular_map);
|
||||
|
||||
int leader_or_admin_map_owner = -1;
|
||||
sm_special_noms.GetValue(map, leader_or_admin_map_owner);
|
||||
strcopy(display, sizeof(display), map);
|
||||
|
||||
bool VIPRestriction = GetMapVIPRestriction(map);
|
||||
if((VIPRestriction) && AreRestrictionsActive())
|
||||
Format(display, sizeof(display), "%s (%T)", display, "VIP Nomination", client);
|
||||
|
||||
int owner = GetArrayCell(OwnerList, i);
|
||||
char spelling[8];
|
||||
|
||||
Format(spelling, sizeof(spelling), nominate_count_for_particular_map == 1 ? "Vote" : "Votes");
|
||||
|
||||
if(!owner)
|
||||
Format(display, sizeof(display), "%s (Admin)", display);
|
||||
else if (Leader_Is(owner))
|
||||
Format(display, sizeof(display), "%s (Leader)", display);
|
||||
if (leader_or_admin_map_owner != -1)
|
||||
{
|
||||
if(!leader_or_admin_map_owner)
|
||||
Format(display, sizeof(display), "%s (Admin)", display);
|
||||
else
|
||||
Format(display, sizeof(display), "%s (Leader)", display);
|
||||
}
|
||||
else
|
||||
Format(display, sizeof(display), "%s (%i %s)", display, nominate_count_for_particular_map, spelling);
|
||||
|
||||
AddMenuItem(menu, map, display);
|
||||
}
|
||||
}
|
||||
@@ -851,6 +855,7 @@ bool PopulateNominateListMenu(Menu menu, int client, const char[] filter = "")
|
||||
delete OwnerList;
|
||||
delete SortedList;
|
||||
delete sm;
|
||||
delete sm_special_noms;
|
||||
delete sm_snapshot;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user