Skip to content

Commit

Permalink
client: use FilteredClientCmd for DRC_CMD_STUFFTEXT
Browse files Browse the repository at this point in the history
  • Loading branch information
Velaron committed Feb 14, 2025
1 parent 3886124 commit 48fea16
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions cl_dll/cl_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ inline struct cvar_s *CVAR_CREATE( const char *cv, const char *val, const int fl
#define GetScreenInfo (*gEngfuncs.pfnGetScreenInfo)
#define ServerCmd (*gEngfuncs.pfnServerCmd)
#define ClientCmd (*gEngfuncs.pfnClientCmd)
#define FilteredClientCmd (*gEngfuncs.pfnFilteredClientCmd)
#define AngleVectors (*gEngfuncs.pfnAngleVectors)
#define Com_RandomLong (*gEngfuncs.pfnRandomLong)
#define Com_RandomFloat (*gEngfuncs.pfnRandomFloat)
Expand Down
2 changes: 1 addition & 1 deletion cl_dll/hud_spectator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,7 @@ void CHudSpectator::DirectorMessage( int iSize, void *pbuf )
break;*/

case DRC_CMD_STUFFTEXT:
ClientCmd( reader.ReadString() );
FilteredClientCmd( reader.ReadString() );
break;
default : gEngfuncs.Con_DPrintf("CHudSpectator::DirectorMessage: unknown command %i.\n", cmd );
}
Expand Down
4 changes: 4 additions & 0 deletions engine/APIProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ typedef void (*pfnEngSrc_pfnFillRGBABlend_t ) ( int x, int y, int width,
typedef int (*pfnEngSrc_pfnGetAppID_t) ( void );
typedef cmdalias_t* (*pfnEngSrc_pfnGetAliases_t) ( void );
typedef void (*pfnEngSrc_pfnVguiWrap2_GetMouseDelta_t) ( int *x, int *y );
typedef int (*pfnEngSrc_pfnFilteredClientCmd_t) ( char *szCmdString );

// Pointers to the exported engine functions themselves
typedef struct cl_enginefuncs_s
Expand Down Expand Up @@ -491,6 +492,7 @@ typedef struct cl_enginefuncs_s
pfnEngSrc_pfnGetAppID_t pfnGetAppID;
pfnEngSrc_pfnGetAliases_t pfnGetAliasList;
pfnEngSrc_pfnVguiWrap2_GetMouseDelta_t pfnVguiWrap2_GetMouseDelta;
pfnEngSrc_pfnFilteredClientCmd_t pfnFilteredClientCmd;
} cl_enginefunc_t;

// Function type declarations for engine destination functions
Expand Down Expand Up @@ -610,6 +612,7 @@ typedef void (*pfnEngDst_pfnFillRGBABlend_t ) ( int *, int *, int *, int *, i
typedef void (*pfnEngDst_pfnGetAppID_t ) ( void );
typedef void (*pfnEngDst_pfnGetAliases_t ) ( void );
typedef void (*pfnEngDst_pfnVguiWrap2_GetMouseDelta_t) ( int *x, int *y );
typedef void (*pfnEngDst_pfnFilteredClientCmd_t ) ( char ** );


// Pointers to the engine destination functions
Expand Down Expand Up @@ -737,6 +740,7 @@ typedef struct
pfnEngDst_pfnGetAppID_t pfnGetAppID;
pfnEngDst_pfnGetAliases_t pfnGetAliasList;
pfnEngDst_pfnVguiWrap2_GetMouseDelta_t pfnVguiWrap2_GetMouseDelta;
pfnEngDst_pfnFilteredClientCmd_t pfnFilteredClientCmd;
} cl_enginefunc_dst_t;


Expand Down
2 changes: 2 additions & 0 deletions engine/cdll_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ extern module_t g_module;
#define RecEnghudHookUserMsg(a, b) (g_engdstAddrs.pfnHookUserMsg(&a, &b))
#define RecEnghudServerCmd(a) (g_engdstAddrs.pfnServerCmd(&a))
#define RecEnghudClientCmd(a) (g_engdstAddrs.pfnClientCmd(&a))
#define RecEnghudFilteredClientCmd(a) (g_engdstAddrs.pfnFilteredClientCmd(&a))
#define RecEngPrimeMusicStream(a, b) (g_engdstAddrs.pfnPrimeMusicStream(&a, &b))
#define RecEnghudGetPlayerInfo(a, b) (g_engdstAddrs.pfnGetPlayerInfo(&a, &b))
#define RecEnghudPlaySoundByName(a, b) (g_engdstAddrs.pfnPlaySoundByName(&a, &b))
Expand Down Expand Up @@ -410,6 +411,7 @@ extern void NullDst(void);
(pfnEngDst_pfnGetAppID_t) NullDst, \
(pfnEngDst_pfnGetAliases_t) NullDst, \
(pfnEngDst_pfnVguiWrap2_GetMouseDelta_t) NullDst, \
(pfnEngDst_pfnFilteredClientCmd_t) NullDst, \
};

// Use this to init a cldll_func_dst structure to point to NullDst
Expand Down

0 comments on commit 48fea16

Please sign in to comment.