typedef void (*xcommand_t) (void); // Pointer to console command handler
typedef struct cmd_function_s {
struct cmd_function_s *next; // Next console command structure
const char *name; // Console command as typed at console (e.g. "stopsound")
xcommand_t function; // Pointer to function called when command is entered
const char *description; // Command description ???
qboolean pure; // ???
} cmd_function_t;
...
typedef cmd_function_t* (*pfnEngSrc_GetFirstCmdFunctionHandle_t)();
typedef cmd_function_t* (*pfnEngSrc_GetNextCmdFunctionHandle_t)(cmd_function_t* cmdhandle);
typedef const char * (*pfnEngSrc_GetCmdFunctionName_t)(cmd_function_t* cmdhandle);
So it looks like it's possible to modify or remove entries in the engine's command list (though maybe we're not meant to given that the definitions in the SDK aren't usable). My question is how modifying the function attribute of cmd_function_t would work - it doesn't seem to take any arguments and from a quick look at Quake's code it looks like the passed arguments are stored in a global char* pointer which the client code probably doesn't have access to. Seems like there isn't a way to usefully override a console command based on the arguments that get passed?edit: is multi-line code formatting possible?