mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2024-12-25 22:35:37 +03:00
Newmenus: Fire MENU_TIMEOUT on menuselect client command
This commit is contained in:
parent
2e8ce87c23
commit
6a4c55de7d
@ -961,13 +961,31 @@ void C_ClientCommand(edict_t *pEntity)
|
||||
|
||||
if (pPlayer->keys & bit_key)
|
||||
{
|
||||
if ((pPlayer->menu > 0 && !pPlayer->vgui) && (gpGlobals->time > pPlayer->menuexpire))
|
||||
if (gpGlobals->time > pPlayer->menuexpire)
|
||||
{
|
||||
int menu = pPlayer->newmenu;
|
||||
if (menu >= 0 && menu < (int)g_NewMenus.size() && g_NewMenus[menu])
|
||||
{
|
||||
Menu *pMenu = g_NewMenus[menu];
|
||||
|
||||
pPlayer->newmenu = -1;
|
||||
pPlayer->menu = 0;
|
||||
|
||||
executeForwards(pMenu->func,
|
||||
static_cast<cell>(pPlayer->index),
|
||||
static_cast<cell>(menu),
|
||||
static_cast<cell>(MENU_TIMEOUT));
|
||||
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
}
|
||||
else if (pPlayer->menu > 0 && !pPlayer->vgui)
|
||||
{
|
||||
pPlayer->menu = 0;
|
||||
pPlayer->keys = 0;
|
||||
|
||||
RETURN_META(MRES_SUPERCEDE);
|
||||
}
|
||||
}
|
||||
|
||||
int menuid = pPlayer->menu;
|
||||
pPlayer->menu = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user