From 5cb07b900ae566f41f2a6ce00a7605bee48c22e5 Mon Sep 17 00:00:00 2001 From: Vincent HERBET Date: Sun, 16 Jun 2013 22:33:48 +0200 Subject: [PATCH] Fix unexpected behaviors when a game menu is overlapped with custom one (bug 3199, r=me) Former-commit-id: 96390761d3b26dd5e6329fa0e836de935b4263c4 --- amxmodx/amxmodx.cpp | 10 ++++++++++ amxmodx/newmenus.cpp | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index f126010b..06b6f6a4 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -1058,6 +1058,11 @@ static cell AMX_NATIVE_CALL show_menu(AMX *amx, cell *params) /* 3 param */ if (pPlayer->ingame) { + pPlayer->keys = 0; + pPlayer->menu = 0; + + UTIL_FakeClientCommand(pPlayer->pEdict, "menuselect", "10", 0); + pPlayer->keys = keys; pPlayer->menu = menuid; pPlayer->vgui = false; @@ -1085,6 +1090,11 @@ static cell AMX_NATIVE_CALL show_menu(AMX *amx, cell *params) /* 3 param */ if (pPlayer->ingame) { + pPlayer->keys = 0; + pPlayer->menu = 0; + + UTIL_FakeClientCommand(pPlayer->pEdict, "menuselect", "10", 0); + pPlayer->keys = keys; pPlayer->menu = menuid; pPlayer->vgui = false; diff --git a/amxmodx/newmenus.cpp b/amxmodx/newmenus.cpp index ff12dfb4..865c9613 100755 --- a/amxmodx/newmenus.cpp +++ b/amxmodx/newmenus.cpp @@ -305,6 +305,11 @@ bool Menu::Display(int player, page_t page) CPlayer *pPlayer = GET_PLAYER_POINTER_I(player); + pPlayer->keys = 0; + pPlayer->menu = 0; + + UTIL_FakeClientCommand(pPlayer->pEdict, "menuselect", "10", 0); + pPlayer->keys = keys; pPlayer->menu = menuId; pPlayer->newmenu = thisId;