zomg fix for oldmenus^2

This commit is contained in:
Borja Ferrer 2005-11-17 23:04:43 +00:00
parent 94308b208a
commit 778c2080b0
5 changed files with 12 additions and 4 deletions

View File

@ -90,6 +90,7 @@ bool CPlayer::Connect(const char* connectname, const char* ipaddress)
time = gpGlobals->time;
bot = IsBot();
death_killer = 0;
menu = 0;
memset(flags, 0, sizeof(flags));
memset(weapons, 0, sizeof(weapons));

View File

@ -86,7 +86,8 @@ public:
bool ingame;
bool bot;
bool authorized;
bool vgui;
float time;
float playtime;
float menuexpire;

View File

@ -925,6 +925,7 @@ static cell AMX_NATIVE_CALL show_menu(AMX *amx, cell *params) /* 3 param */
{
pPlayer->keys = keys;
pPlayer->menu = menuid;
pPlayer->vgui = false;
if (time == -1)
pPlayer->menuexpire = INFINITE;
@ -951,7 +952,8 @@ static cell AMX_NATIVE_CALL show_menu(AMX *amx, cell *params) /* 3 param */
{
pPlayer->keys = keys;
pPlayer->menu = menuid;
pPlayer->vgui = false;
if (time == -1)
pPlayer->menuexpire = INFINITE;
else

View File

@ -59,6 +59,8 @@ void Client_VGUIMenu(void* mValue)
{
if (!mPlayer) return;
mPlayer->vgui = true;
switch (mState++)
{
case 0:
@ -72,7 +74,9 @@ void Client_VGUIMenu(void* mValue)
void Client_ShowMenu(void* mValue)
{
if (!mPlayer) return;
mPlayer->vgui = true;
switch (mState++)
{
case 0:

View File

@ -716,7 +716,7 @@ void C_ClientCommand(edict_t *pEntity)
if (pPlayer->keys & bit_key)
{
if ((pPlayer->menu > 0) && (gpGlobals->time > pPlayer->menuexpire))
if ((pPlayer->menu > 0 && !pPlayer->vgui) && (gpGlobals->time > pPlayer->menuexpire))
{
pPlayer->menu = 0;
pPlayer->keys = 0;