From ca37ab2a846942497df7a9f059ca5bc4e49bad6c Mon Sep 17 00:00:00 2001 From: BotoX Date: Mon, 2 Dec 2019 23:32:55 +0100 Subject: [PATCH] fix bugs in nominations_extended from last commits --- .../scripting/nominations_extended.sp | 32 ++++++++----------- 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/mapchooser_extended/scripting/nominations_extended.sp b/mapchooser_extended/scripting/nominations_extended.sp index 6f90b3c4..9cae2973 100644 --- a/mapchooser_extended/scripting/nominations_extended.sp +++ b/mapchooser_extended/scripting/nominations_extended.sp @@ -857,28 +857,24 @@ public int Handler_MapSelectMenu(Menu menu, MenuAction action, int param1, int p GetMenuItem(menu, param2, map, sizeof(map)); int status; - - if(!GetTrieValue(g_mapTrie, map, status)) + if(GetTrieValue(g_mapTrie, map, status)) { - LogError("Menu selection of item not in trie. Major logic problem somewhere."); - return ITEMDRAW_DEFAULT; - } - - if((status & MAPSTATUS_DISABLED) == MAPSTATUS_DISABLED) - { - if((status & MAPSTATUS_EXCLUDE_CURRENT) == MAPSTATUS_EXCLUDE_CURRENT) + if((status & MAPSTATUS_DISABLED) == MAPSTATUS_DISABLED) { - return ITEMDRAW_DISABLED; - } + if((status & MAPSTATUS_EXCLUDE_CURRENT) == MAPSTATUS_EXCLUDE_CURRENT) + { + return ITEMDRAW_DISABLED; + } - if(AreRestrictionsActive() && (status & MAPSTATUS_EXCLUDE_PREVIOUS) == MAPSTATUS_EXCLUDE_PREVIOUS) - { - return ITEMDRAW_DISABLED; - } + if(AreRestrictionsActive() && (status & MAPSTATUS_EXCLUDE_PREVIOUS) == MAPSTATUS_EXCLUDE_PREVIOUS) + { + return ITEMDRAW_DISABLED; + } - if((status & MAPSTATUS_EXCLUDE_NOMINATED) == MAPSTATUS_EXCLUDE_NOMINATED) - { - return ITEMDRAW_DISABLED; + if((status & MAPSTATUS_EXCLUDE_NOMINATED) == MAPSTATUS_EXCLUDE_NOMINATED) + { + return ITEMDRAW_DISABLED; + } } }