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

Locked
Pyrite
Posts: 10
Joined: Wed Feb 16, 2000 8:00 am

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

Post 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.
^misantropia^
Posts: 4022
Joined: Sat Mar 12, 2005 6:24 pm

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

Post 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.
Pyrite
Posts: 10
Joined: Wed Feb 16, 2000 8:00 am

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

Post 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.
Locked