From a93886fb65debbd5d1ccc4631f3f1c12bea0d529 Mon Sep 17 00:00:00 2001 From: Arkshine Date: Thu, 18 Sep 2014 19:17:00 +0200 Subject: [PATCH 1/2] Fix unreachable code warning (reported by kwpd) --- plugins/pluginmenu.sma | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/plugins/pluginmenu.sma b/plugins/pluginmenu.sma index 8913a23c..d85319aa 100644 --- a/plugins/pluginmenu.sma +++ b/plugins/pluginmenu.sma @@ -470,19 +470,16 @@ public CvarMenuSelection(id, menu, item) { DisplayPluginMenuDefault(id); } - return PLUGIN_HANDLED; } else if (item==MENU_BACK) { --CurrentPage[id]; client_print(id,print_chat,"MENU_BACK"); - return PLUGIN_HANDLED; } else if (item==MENU_MORE) { ++CurrentPage[id]; client_print(id,print_chat,"MENU_MORE"); - return PLUGIN_HANDLED; } else { @@ -497,7 +494,6 @@ public CvarMenuSelection(id, menu, item) if (CurrentCvar[id]==0) // This should never happen, but just incase.. { client_print(id,print_chat,"[AMXX] There was an error extracting the cvar pointer. (Name=^"%s^")",CvarName); - return PLUGIN_HANDLED; } // TODO: ML this @@ -515,10 +511,9 @@ public CvarMenuSelection(id, menu, item) client_cmd(id,"messagemode amx_changecvar"); menu_destroy(menu); - return PLUGIN_HANDLED; } - return 0; + return PLUGIN_HANDLED; } /** * Displays the cvar menu to a client. @@ -785,7 +780,6 @@ public CommandExecuteCommand(id) */ public CommandMenuSelection(id, menu, item) { - if (item==MENU_EXIT) { menu_destroy(menu); @@ -797,19 +791,16 @@ public CommandMenuSelection(id, menu, item) { client_cmd(id,"amx_plugincmdmenu"); } - return PLUGIN_HANDLED; } else if (item==MENU_BACK) { --CurrentPage[id]; client_print(id,print_chat,"MENU_BACK"); - return PLUGIN_HANDLED; } else if (item==MENU_MORE) { ++CurrentPage[id]; client_print(id,print_chat,"MENU_MORE"); - return PLUGIN_HANDLED; } else { @@ -821,10 +812,9 @@ public CommandMenuSelection(id, menu, item) menu_destroy(menu); DisplaySpecificCommand(id,str_to_num(Command)); - return PLUGIN_HANDLED; } - return 0; + return PLUGIN_HANDLED; } /** * This blocks "say" and "say_team" commands. From c1dca680f2a30fb73afb551de86f97a1680d6ccc Mon Sep 17 00:00:00 2001 From: Arkshine Date: Thu, 18 Sep 2014 19:35:29 +0200 Subject: [PATCH 2/2] Don't remove this return --- plugins/pluginmenu.sma | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/pluginmenu.sma b/plugins/pluginmenu.sma index d85319aa..b35dfdd2 100644 --- a/plugins/pluginmenu.sma +++ b/plugins/pluginmenu.sma @@ -493,7 +493,8 @@ public CvarMenuSelection(id, menu, item) if (CurrentCvar[id]==0) // This should never happen, but just incase.. { - client_print(id,print_chat,"[AMXX] There was an error extracting the cvar pointer. (Name=^"%s^")",CvarName); + client_print(id,print_chat,"[AMXX] There was an error extracting the cvar pointer. (Name=^"%s^")",CvarName); + return PLUGIN_HANDLED; } // TODO: ML this