Newmenus: Add MENU_TIMEOUT status code and pass it where necessary

This commit is contained in:
Valentin Grünbacher
2014-05-21 18:45:40 +02:00
parent cd7cb8c1a8
commit 2e8ce87c23
4 changed files with 42 additions and 8 deletions

View File

@@ -70,13 +70,19 @@ void CPlayer::Disconnect()
Menu *pMenu = g_NewMenus[newmenu];
if (pMenu)
{
int status;
if (gpGlobals->time > menuexpire)
status = MENU_TIMEOUT;
else
status = MENU_EXIT;
//prevent recursion
newmenu = -1;
menu = 0;
executeForwards(pMenu->func,
static_cast<cell>(ENTINDEX(pEdict)),
static_cast<cell>(pMenu->thisId),
static_cast<cell>(MENU_EXIT));
static_cast<cell>(status));
}
}