diff --git a/cl_dll/cdll_int.cpp b/cl_dll/cdll_int.cpp index 23da5ae7..17fc06f3 100644 --- a/cl_dll/cdll_int.cpp +++ b/cl_dll/cdll_int.cpp @@ -167,7 +167,17 @@ int DLLEXPORT Initialize( cl_enginefunc_t *pEnginefuncs, int iVersion ) if( iVersion != CLDLL_INTERFACE_VERSION ) return 0; - memcpy( &gEngfuncs, pEnginefuncs, sizeof(cl_enginefunc_t) ); + // for now filterstuffcmd is last in the engine interface + memcpy( &gEngfuncs, pEnginefuncs, sizeof(cl_enginefunc_t) - sizeof( void * ) ); + + if( gEngfuncs.pfnGetCvarPointer( "cl_filterstuffcmd" ) == 0 ) + { + gEngfuncs.pfnFilteredClientCmd = gEngfuncs.pfnClientCmd; + } + else + { + gEngfuncs.pfnFilteredClientCmd = pEnginefuncs->pfnFilteredClientCmd; + } EV_HookEvents(); diff --git a/cl_dll/hud_spectator.cpp b/cl_dll/hud_spectator.cpp index bfd8112b..c20e6ba0 100644 --- a/cl_dll/hud_spectator.cpp +++ b/cl_dll/hud_spectator.cpp @@ -577,7 +577,7 @@ void CHudSpectator::DirectorMessage( int iSize, void *pbuf ) case DRC_CMD_FADE: break; case DRC_CMD_STUFFTEXT: - ClientCmd( READ_STRING() ); + gEngfuncs.pfnFilteredClientCmd( READ_STRING() ); break; default: gEngfuncs.Con_DPrintf( "CHudSpectator::DirectorMessage: unknown command %i.\n", cmd ); diff --git a/cl_dll/vgui_TeamFortressViewport.h b/cl_dll/vgui_TeamFortressViewport.h index 39c6b26f..ee295b59 100644 --- a/cl_dll/vgui_TeamFortressViewport.h +++ b/cl_dll/vgui_TeamFortressViewport.h @@ -667,7 +667,7 @@ public: virtual void actionPerformed(Panel *panel) { - gEngfuncs.pfnClientCmd( m_pszCommand ); + gEngfuncs.pfnFilteredClientCmd( m_pszCommand ); if( m_iCloseVGUIMenu ) gViewPort->HideTopMenu(); diff --git a/engine/cdll_int.h b/engine/cdll_int.h index 02d277dd..64620497 100644 --- a/engine/cdll_int.h +++ b/engine/cdll_int.h @@ -303,6 +303,9 @@ typedef struct cl_enginefuncs_s int (*pfnGetAppID)( void ); cmdalias_t *(*pfnGetAliases)( void ); void (*pfnVguiWrap2_GetMouseDelta)( int *x, int *y ); + + // added in 2019 update, not documented yet + int (*pfnFilteredClientCmd)( const char *cmd ); } cl_enginefunc_t; #define CLDLL_INTERFACE_VERSION 7