From c8b7a09028e4855861c52f453eb9b0bbcef26a4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Gr=C3=BCnbacher?= Date: Wed, 21 May 2014 19:01:27 +0200 Subject: [PATCH] Newmenus: get_user_menu should also handle newmenu timeouts properly --- amxmodx/amxmodx.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index fd09387b..d2ae3f13 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -2962,7 +2962,14 @@ static cell AMX_NATIVE_CALL get_user_menu(AMX *amx, cell *params) /* 3 param */ { if (gpGlobals->time > pPlayer->menuexpire) { - pPlayer->menu = 0; + int menu = pPlayer->newmenu; + if (menu >= 0 && menu < (int)g_NewMenus.size() && g_NewMenus[menu]) + { + Menu *pMenu = g_NewMenus[menu]; + pMenu->Close(pPlayer->index); + } + else + pPlayer->menu = 0; *cpMenu = 0; *cpKeys = 0;