Quake3World.com Forums
     Programming Discussion
        Calling commands in sv_ccmds.c from within sv_ccmds.c ?


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: Calling commands in sv_ccmds.c from within sv_ccmds.c ?

The Afflicted
The Afflicted
Joined: 16 Feb 2000
Posts: 752
PostPosted: 05-17-2010 11:36 AM           Profile Send private message  E-mail  Edit post Reply with quote


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.




Top
                 

Mentor
Mentor
Joined: 12 Mar 2005
Posts: 3958
PostPosted: 05-17-2010 07:45 PM           Profile Send private message  E-mail  Edit post Reply with quote


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.




Top
                 

The Afflicted
The Afflicted
Joined: 16 Feb 2000
Posts: 752
PostPosted: 05-18-2010 01:38 PM           Profile Send private message  E-mail  Edit post Reply with quote


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.




Top
                 
Quake3World.com | Forum Index | Programming Discussion


Post new topic Reply to topic


cron
Quake3World.com
© ZeniMax. Zenimax, QUAKE III ARENA, Id Software and associated trademarks are trademarks of the ZeniMax group of companies. All rights reserved.
This is an unofficial fan website without any affiliation with or endorsement by ZeniMax.
All views and opinions expressed are those of the author.