From 0b66a6acee86d2faba89eac56a09aa829b9f6436 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 18 Oct 2007 01:08:48 +0000 Subject: [PATCH] fixed a regression where valve-style menus stopped working --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401611 --- core/MenuStyle_Valve.cpp | 12 +++--------- core/MenuStyle_Valve.h | 1 - 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/core/MenuStyle_Valve.cpp b/core/MenuStyle_Valve.cpp index 501cc32e..dccace41 100644 --- a/core/MenuStyle_Valve.cpp +++ b/core/MenuStyle_Valve.cpp @@ -41,7 +41,6 @@ SH_DECL_HOOK4_void(IServerPluginHelpers, CreateMessage, SH_NOATTRIB, false, edic ValveMenuStyle g_ValveMenuStyle; extern const char *g_OptionNumTable[]; extern const char *g_OptionCmdTable[]; -IServerPluginCallbacks *g_pVSPHandle = NULL; CallClass *g_pSPHCC = NULL; ValveMenuStyle::ValveMenuStyle() : m_players(new CValveMenuPlayer[256+1]) @@ -114,11 +113,6 @@ void ValveMenuStyle::HookCreateMessage(edict_t *pEdict, } } -void ValveMenuStyle::OnSourceModVSPReceived(IServerPluginCallbacks *iface) -{ - g_pVSPHandle = iface; -} - IMenuPanel *ValveMenuStyle::CreatePanel() { return new CValveMenuDisplay(); @@ -148,7 +142,7 @@ void ValveMenuStyle::SendDisplay(int client, IMenuPanel *display) bool ValveMenuStyle::DoClientMenu(int client, IMenuPanel *menu, IMenuHandler *mh, unsigned int time) { - if (!g_pVSPHandle) + if (vsp_interface == NULL) { return false; } @@ -158,7 +152,7 @@ bool ValveMenuStyle::DoClientMenu(int client, IMenuPanel *menu, IMenuHandler *mh bool ValveMenuStyle::DoClientMenu(int client, CBaseMenu *menu, unsigned int first_item, IMenuHandler *mh, unsigned int time) { - if (!g_pVSPHandle) + if (vsp_interface == NULL) { mh->OnMenuStart(menu); mh->OnMenuCancel(menu, client, MenuCancel_NoDisplay); @@ -329,7 +323,7 @@ void CValveMenuDisplay::SendRawDisplay(int client, int priority, unsigned int ti engine->PEntityOfEntIndex(client), DIALOG_MENU, m_pKv, - g_pVSPHandle); + vsp_interface); } bool CValveMenuDisplay::SendDisplay(int client, IMenuHandler *handler, unsigned int time) diff --git a/core/MenuStyle_Valve.h b/core/MenuStyle_Valve.h index 1551c600..b59967c2 100644 --- a/core/MenuStyle_Valve.h +++ b/core/MenuStyle_Valve.h @@ -69,7 +69,6 @@ public: //BaseMenuStyle public: //SMGlobalClass void OnSourceModAllInitialized(); void OnSourceModShutdown(); - void OnSourceModVSPReceived(IServerPluginCallbacks *iface); public: //IMenuStyle const char *GetStyleName(); IMenuPanel *CreatePanel();