fixed a bug where disconnected clients did not have their menus cancelled for radio style menus
authorDavid Anderson <dvander@alliedmods.net>
Wed May 23 16:56:24 2007 +0000 (2007-05-23)
changeset 846b7abf6295b42
parent 845 081ba05c591c
child 847 133dc1075efd
fixed a bug where disconnected clients did not have their menus cancelled for radio style menus
core/MenuStyle_Radio.cpp
core/MenuStyle_Radio.h
     1.1 --- a/core/MenuStyle_Radio.cpp	Wed May 23 15:49:28 2007 +0000
     1.2 +++ b/core/MenuStyle_Radio.cpp	Wed May 23 16:56:24 2007 +0000
     1.3 @@ -16,6 +16,7 @@
     1.4  #include "sm_stringutil.h"
     1.5  #include "UserMessages.h"
     1.6  #include "GameConfigs.h"
     1.7 +#include "PlayerManager.h"
     1.8  
     1.9  extern const char *g_RadioNumTable[];
    1.10  CRadioStyle g_RadioMenuStyle;
    1.11 @@ -26,6 +27,11 @@
    1.12  {
    1.13  }
    1.14  
    1.15 +void CRadioStyle::OnSourceModAllInitialized()
    1.16 +{
    1.17 +	g_Players.AddClientListener(this);
    1.18 +}
    1.19 +
    1.20  void CRadioStyle::OnSourceModLevelChange(const char *mapName)
    1.21  {
    1.22  	if (g_bRadioInit)
    1.23 @@ -55,6 +61,7 @@
    1.24  
    1.25  void CRadioStyle::OnSourceModShutdown()
    1.26  {
    1.27 +	g_Players.RemoveClientListener(this);
    1.28  	g_UserMsgs.UnhookUserMessage(g_ShowMenuId, this, false);
    1.29  
    1.30  	while (!m_FreeDisplays.empty())
     2.1 --- a/core/MenuStyle_Radio.h	Wed May 23 15:49:28 2007 +0000
     2.2 +++ b/core/MenuStyle_Radio.h	Wed May 23 16:56:24 2007 +0000
     2.3 @@ -37,6 +37,7 @@
     2.4  public:
     2.5  	CRadioStyle();
     2.6  public: //SMGlobalClass
     2.7 +	void OnSourceModAllInitialized();
     2.8  	void OnSourceModLevelChange(const char *mapName);
     2.9  	void OnSourceModShutdown();
    2.10  public: //BaseMenuStyle