Newmenus: get_user_menu should also handle newmenu timeouts properly

This commit is contained in:
Valentin Grünbacher 2014-05-21 19:01:27 +02:00
parent fa5336cade
commit c8b7a09028

View File

@ -2962,6 +2962,13 @@ static cell AMX_NATIVE_CALL get_user_menu(AMX *amx, cell *params) /* 3 param */
{ {
if (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];
pMenu->Close(pPlayer->index);
}
else
pPlayer->menu = 0; pPlayer->menu = 0;
*cpMenu = 0; *cpMenu = 0;