Mapchooser: Fix obvious bug, seems noone noticed.
This commit is contained in:
parent
2c3b0c9233
commit
1d7688ee00
@ -862,7 +862,7 @@ public int Handler_AdminMapSelectMenu(Menu menu, MenuAction action, int param1,
|
|||||||
|
|
||||||
case MenuAction_DrawItem:
|
case MenuAction_DrawItem:
|
||||||
{
|
{
|
||||||
if(CheckCommandAccess(param1, "sm_nominate_ignore", ADMFLAG_CHEATS, true))
|
if(!CheckCommandAccess(param1, "sm_nominate_ignore", ADMFLAG_CHEATS, true))
|
||||||
{
|
{
|
||||||
static char map[PLATFORM_MAX_PATH];
|
static char map[PLATFORM_MAX_PATH];
|
||||||
GetMenuItem(menu, param2, map, sizeof(map));
|
GetMenuItem(menu, param2, map, sizeof(map));
|
||||||
@ -883,58 +883,58 @@ public int Handler_AdminMapSelectMenu(Menu menu, MenuAction action, int param1,
|
|||||||
|
|
||||||
case MenuAction_DisplayItem:
|
case MenuAction_DisplayItem:
|
||||||
{
|
{
|
||||||
if(CheckCommandAccess(param1, "sm_nominate_ignore", ADMFLAG_CHEATS, true))
|
if(!CheckCommandAccess(param1, "sm_nominate_ignore", ADMFLAG_CHEATS, true))
|
||||||
return 0;
|
|
||||||
|
|
||||||
static char map[PLATFORM_MAX_PATH];
|
|
||||||
GetMenuItem(menu, param2, map, sizeof(map));
|
|
||||||
|
|
||||||
static char buffer[100];
|
|
||||||
static char display[150];
|
|
||||||
|
|
||||||
int status;
|
|
||||||
if(GetTrieValue(g_mapTrie, map, status))
|
|
||||||
{
|
{
|
||||||
if((status & MAPSTATUS_DISABLED) == MAPSTATUS_DISABLED)
|
static char map[PLATFORM_MAX_PATH];
|
||||||
|
GetMenuItem(menu, param2, map, sizeof(map));
|
||||||
|
|
||||||
|
static char buffer[100];
|
||||||
|
static char display[150];
|
||||||
|
|
||||||
|
int status;
|
||||||
|
if(GetTrieValue(g_mapTrie, map, status))
|
||||||
{
|
{
|
||||||
if((status & MAPSTATUS_EXCLUDE_CURRENT) == MAPSTATUS_EXCLUDE_CURRENT)
|
if((status & MAPSTATUS_DISABLED) == MAPSTATUS_DISABLED)
|
||||||
{
|
{
|
||||||
Format(display, sizeof(display), "%s (%T)", buffer, "Current Map", param1);
|
if((status & MAPSTATUS_EXCLUDE_CURRENT) == MAPSTATUS_EXCLUDE_CURRENT)
|
||||||
return RedrawMenuItem(display);
|
{
|
||||||
}
|
Format(display, sizeof(display), "%s (%T)", buffer, "Current Map", param1);
|
||||||
|
return RedrawMenuItem(display);
|
||||||
|
}
|
||||||
|
|
||||||
if((status & MAPSTATUS_EXCLUDE_PREVIOUS) == MAPSTATUS_EXCLUDE_PREVIOUS)
|
if((status & MAPSTATUS_EXCLUDE_PREVIOUS) == MAPSTATUS_EXCLUDE_PREVIOUS)
|
||||||
{
|
{
|
||||||
int Cooldown = GetMapCooldown(map);
|
int Cooldown = GetMapCooldown(map);
|
||||||
Format(display, sizeof(display), "%s (%T %d)", buffer, "Recently Played", param1, Cooldown);
|
Format(display, sizeof(display), "%s (%T %d)", buffer, "Recently Played", param1, Cooldown);
|
||||||
return RedrawMenuItem(display);
|
return RedrawMenuItem(display);
|
||||||
}
|
}
|
||||||
|
|
||||||
if((status & MAPSTATUS_EXCLUDE_NOMINATED) == MAPSTATUS_EXCLUDE_NOMINATED)
|
if((status & MAPSTATUS_EXCLUDE_NOMINATED) == MAPSTATUS_EXCLUDE_NOMINATED)
|
||||||
{
|
{
|
||||||
Format(display, sizeof(display), "%s (%T)", buffer, "Nominated", param1);
|
Format(display, sizeof(display), "%s (%T)", buffer, "Nominated", param1);
|
||||||
return RedrawMenuItem(display);
|
return RedrawMenuItem(display);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
int TimeRestriction = GetMapTimeRestriction(map);
|
int TimeRestriction = GetMapTimeRestriction(map);
|
||||||
if(TimeRestriction)
|
if(TimeRestriction)
|
||||||
{
|
{
|
||||||
Format(display, sizeof(display), "%s (%T)", buffer, "Map Time Restriction", param1, "+", RoundToFloor(float(TimeRestriction / 60)), TimeRestriction % 60);
|
Format(display, sizeof(display), "%s (%T)", buffer, "Map Time Restriction", param1, "+", RoundToFloor(float(TimeRestriction / 60)), TimeRestriction % 60);
|
||||||
|
|
||||||
return RedrawMenuItem(display);
|
return RedrawMenuItem(display);
|
||||||
}
|
}
|
||||||
|
|
||||||
int PlayerRestriction = GetMapPlayerRestriction(map);
|
int PlayerRestriction = GetMapPlayerRestriction(map);
|
||||||
if(PlayerRestriction)
|
if(PlayerRestriction)
|
||||||
{
|
{
|
||||||
if(PlayerRestriction < 0)
|
if(PlayerRestriction < 0)
|
||||||
Format(display, sizeof(display), "%s (%T)", buffer, "Map Player Restriction", param1, "+", PlayerRestriction * -1);
|
Format(display, sizeof(display), "%s (%T)", buffer, "Map Player Restriction", param1, "+", PlayerRestriction * -1);
|
||||||
else
|
else
|
||||||
Format(display, sizeof(display), "%s (%T)", buffer, "Map Player Restriction", param1, "-", PlayerRestriction);
|
Format(display, sizeof(display), "%s (%T)", buffer, "Map Player Restriction", param1, "-", PlayerRestriction);
|
||||||
|
|
||||||
return RedrawMenuItem(display);
|
return RedrawMenuItem(display);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user