Skip to content

Commit b9c961b

Browse files
committed
Fix game_menu conflicting with voice command menu
1 parent 3226065 commit b9c961b

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/game/client/menu.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ class CHudMenu : public CHudElement, public vgui::Panel
4141
bool IsMenuOpen( void );
4242
void SelectMenuItem( int menu_item );
4343

44+
#ifdef MAPBASE
45+
bool IsMenuMapDefined() const { return m_bMapDefinedMenu; }
46+
#endif
47+
4448
private:
4549
virtual void OnThink();
4650
virtual void Paint();

src/game/client/voice_menu.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ void OpenVoiceMenu( int index )
5050
if ( !pMenu )
5151
return;
5252

53+
#ifdef MAPBASE
54+
// Don't override map-defined menus
55+
if ( pMenu->IsMenuMapDefined() && pMenu->IsMenuOpen() )
56+
return;
57+
#endif
58+
5359
// if they hit the key again, close the menu
5460
if ( g_ActiveVoiceMenu == index )
5561
{

0 commit comments

Comments
 (0)