Page 1 of 1

Calling commands in sv_ccmds.c from within sv_ccmds.c ?

Posted: Mon May 17, 2010 7:36 pm
by Pyrite
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.

Re: Calling commands in sv_ccmds.c from within sv_ccmds.c ?

Posted: Tue May 18, 2010 3:45 am
by ^misantropia^
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 ?

Posted: Tue May 18, 2010 9:38 pm
by Pyrite
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.