From ad834490441f3c38934d639edc109ef9d4c670cf Mon Sep 17 00:00:00 2001 From: terencehill Date: Wed, 6 Jul 2016 19:45:54 +0200 Subject: [PATCH] Reset QuickMenu_Page_Command_Type when clearing up a quickmenu command otherwise very bad things may happen (crash opening the hud editor) --- qcsrc/client/hud/panel/quickmenu.qc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qcsrc/client/hud/panel/quickmenu.qc b/qcsrc/client/hud/panel/quickmenu.qc index 08d97ffd2..d7d2b163d 100644 --- a/qcsrc/client/hud/panel/quickmenu.qc +++ b/qcsrc/client/hud/panel/quickmenu.qc @@ -58,6 +58,7 @@ void QuickMenu_Page_ClearEntry(int i) if (QuickMenu_Page_Command[i]) strunzone(QuickMenu_Page_Command[i]); QuickMenu_Page_Command[i] = string_null; + QuickMenu_Page_Command_Type[i] = 0; } float QuickMenu_Page_Load(string target_submenu, float new_page); @@ -660,7 +661,7 @@ void HUD_QuickMenu() else tokenize_console(substring(QuickMenu_Page_Command[i], 0, end)); - //if(argv(1) && argv(0) == "toggle") // already checked + if(argv(1) && argv(0) == "toggle") { // "enable feature xxx" "toggle xxx" (or "toggle xxx 1 0") // "disable feature xxx" "toggle xxx 0 1" -- 2.39.2