How can I use a command defined in sv_ccmds.c from within that file?
Like in my function I want to call the function defined as:
static client_t *SV_GetPlayerByNum( void )
but it looks like it doesn't accept any parameters, as they are supplied elsewhere.
Calling commands in sv_ccmds.c from within sv_ccmds.c ?
-
- Posts: 4022
- Joined: Sat Mar 12, 2005 6:24 pm
Re: Calling commands in sv_ccmds.c from within sv_ccmds.c ?
Yep. When a command is entered, its parameters are parsed in an argv-like structure you can query with Cmd_Argv(). That essentially means you can only call it when parsing/executing a command.
Re: Calling commands in sv_ccmds.c from within sv_ccmds.c ?
can't believe there isn't a way to utilize what's already there, but for now, I just copied the code from the function I wanted to use into my own custom function.