Newmenus: Use Menu::Close everywhere

This commit is contained in:
Valentin Grünbacher
2014-05-21 18:58:51 +02:00
parent 34337fb959
commit fa5336cade
4 changed files with 8 additions and 80 deletions

View File

@ -1298,15 +1298,7 @@ static cell AMX_NATIVE_CALL show_menu(AMX *amx, cell *params) /* 3 param */
if (menu >= 0 && menu < (int)g_NewMenus.size() && g_NewMenus[menu])
{
Menu *pMenu = g_NewMenus[menu];
int status;
if (gpGlobals->time > pPlayer->menuexpire)
status = MENU_TIMEOUT;
else
status = MENU_EXIT;
pPlayer->newmenu = -1;
executeForwards(pMenu->func, static_cast<cell>(pPlayer->index), static_cast<cell>(menu), static_cast<cell>(status));
pMenu->Close(pPlayer->index);
}
UTIL_FakeClientCommand(pPlayer->pEdict, "menuselect", "10", 0);
@ -1345,15 +1337,7 @@ static cell AMX_NATIVE_CALL show_menu(AMX *amx, cell *params) /* 3 param */
if (menu >= 0 && menu < (int)g_NewMenus.size() && g_NewMenus[menu])
{
Menu *pMenu = g_NewMenus[menu];
int status;
if (gpGlobals->time > pPlayer->menuexpire)
status = MENU_TIMEOUT;
else
status = MENU_EXIT;
pPlayer->newmenu = -1;
executeForwards(pMenu->func, static_cast<cell>(pPlayer->index), static_cast<cell>(menu), static_cast<cell>(status));
pMenu->Close(pPlayer->index);
}
UTIL_FakeClientCommand(pPlayer->pEdict, "menuselect", "10", 0);