From 1d7688ee00bfd9d9580f6a15bc77e60f3170fd60 Mon Sep 17 00:00:00 2001 From: zaCade Date: Thu, 19 Oct 2017 19:48:37 +0200 Subject: [PATCH] Mapchooser: Fix obvious bug, seems noone noticed. --- .../scripting/nominations_extended.sp | 84 +++++++++---------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/mapchooser_extended/scripting/nominations_extended.sp b/mapchooser_extended/scripting/nominations_extended.sp index 8e165457..bb534708 100644 --- a/mapchooser_extended/scripting/nominations_extended.sp +++ b/mapchooser_extended/scripting/nominations_extended.sp @@ -862,7 +862,7 @@ public int Handler_AdminMapSelectMenu(Menu menu, MenuAction action, int param1, 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]; GetMenuItem(menu, param2, map, sizeof(map)); @@ -883,58 +883,58 @@ public int Handler_AdminMapSelectMenu(Menu menu, MenuAction action, int param1, case MenuAction_DisplayItem: { - 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(!CheckCommandAccess(param1, "sm_nominate_ignore", ADMFLAG_CHEATS, true)) { - 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); - return RedrawMenuItem(display); - } + if((status & MAPSTATUS_EXCLUDE_CURRENT) == MAPSTATUS_EXCLUDE_CURRENT) + { + Format(display, sizeof(display), "%s (%T)", buffer, "Current Map", param1); + return RedrawMenuItem(display); + } - if((status & MAPSTATUS_EXCLUDE_PREVIOUS) == MAPSTATUS_EXCLUDE_PREVIOUS) - { - int Cooldown = GetMapCooldown(map); - Format(display, sizeof(display), "%s (%T %d)", buffer, "Recently Played", param1, Cooldown); - return RedrawMenuItem(display); - } + if((status & MAPSTATUS_EXCLUDE_PREVIOUS) == MAPSTATUS_EXCLUDE_PREVIOUS) + { + int Cooldown = GetMapCooldown(map); + Format(display, sizeof(display), "%s (%T %d)", buffer, "Recently Played", param1, Cooldown); + return RedrawMenuItem(display); + } - if((status & MAPSTATUS_EXCLUDE_NOMINATED) == MAPSTATUS_EXCLUDE_NOMINATED) - { - Format(display, sizeof(display), "%s (%T)", buffer, "Nominated", param1); - return RedrawMenuItem(display); + if((status & MAPSTATUS_EXCLUDE_NOMINATED) == MAPSTATUS_EXCLUDE_NOMINATED) + { + Format(display, sizeof(display), "%s (%T)", buffer, "Nominated", param1); + return RedrawMenuItem(display); + } } } - } - int TimeRestriction = GetMapTimeRestriction(map); - if(TimeRestriction) - { - Format(display, sizeof(display), "%s (%T)", buffer, "Map Time Restriction", param1, "+", RoundToFloor(float(TimeRestriction / 60)), TimeRestriction % 60); + int TimeRestriction = GetMapTimeRestriction(map); + if(TimeRestriction) + { + 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); - if(PlayerRestriction) - { - if(PlayerRestriction < 0) - Format(display, sizeof(display), "%s (%T)", buffer, "Map Player Restriction", param1, "+", PlayerRestriction * -1); - else - Format(display, sizeof(display), "%s (%T)", buffer, "Map Player Restriction", param1, "-", PlayerRestriction); + int PlayerRestriction = GetMapPlayerRestriction(map); + if(PlayerRestriction) + { + if(PlayerRestriction < 0) + Format(display, sizeof(display), "%s (%T)", buffer, "Map Player Restriction", param1, "+", PlayerRestriction * -1); + else + Format(display, sizeof(display), "%s (%T)", buffer, "Map Player Restriction", param1, "-", PlayerRestriction); - return RedrawMenuItem(display); + return RedrawMenuItem(display); + } } return 0;