AddCommand is more informative now.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@782 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-01-15 17:39:12 +00:00
parent ccf7e8bfe6
commit fb69253127
2 changed files with 12 additions and 8 deletions

View file

@ -1190,7 +1190,7 @@ void Cmd_TokenizeString (char *text, qboolean expandmacros, qboolean qctokenize)
Cmd_AddCommand
============
*/
void Cmd_AddCommand (char *cmd_name, xcommand_t function)
qboolean Cmd_AddCommand (char *cmd_name, xcommand_t function)
{
cmd_function_t *cmd;
@ -1201,7 +1201,7 @@ void Cmd_AddCommand (char *cmd_name, xcommand_t function)
if (Cvar_VariableString(cmd_name)[0])
{
Con_Printf ("Cmd_AddCommand: %s already defined as a var\n", cmd_name);
return;
return false;
}
// fail if the command already exists
@ -1210,7 +1210,7 @@ void Cmd_AddCommand (char *cmd_name, xcommand_t function)
if (!Q_strcmp (cmd_name, cmd->name))
{
Con_Printf ("Cmd_AddCommand: %s already defined\n", cmd_name);
return;
return false;
}
}
@ -1220,9 +1220,11 @@ void Cmd_AddCommand (char *cmd_name, xcommand_t function)
cmd->next = cmd_functions;
cmd->restriction = 0;
cmd_functions = cmd;
return true;
}
void Cmd_AddRemCommand (char *cmd_name, xcommand_t function)
qboolean Cmd_AddRemCommand (char *cmd_name, xcommand_t function)
{
cmd_function_t *cmd;
@ -1230,7 +1232,7 @@ void Cmd_AddRemCommand (char *cmd_name, xcommand_t function)
if (Cvar_VariableString(cmd_name)[0])
{
Con_Printf ("Cmd_AddCommand: %s already defined as a var\n", cmd_name);
return;
return false;
}
// fail if the command already exists
@ -1239,7 +1241,7 @@ void Cmd_AddRemCommand (char *cmd_name, xcommand_t function)
if (!Q_strcmp (cmd_name, cmd->name))
{
Con_Printf ("Cmd_AddCommand: %s already defined\n", cmd_name);
return;
return false;
}
}
@ -1250,6 +1252,8 @@ void Cmd_AddRemCommand (char *cmd_name, xcommand_t function)
cmd->restriction = 0;
cmd->zmalloced = true;
cmd_functions = cmd;
return true;
}
void Cmd_RemoveCommand (char *cmd_name)

View file

@ -72,8 +72,8 @@ void Cmd_Init (void);
void Cmd_StuffCmds (void);
void Cmd_RemoveCommand (char *cmd_name);
void Cmd_AddRemCommand (char *cmd_name, xcommand_t function); //removable command
void Cmd_AddCommand (char *cmd_name, xcommand_t function);
qboolean Cmd_AddRemCommand (char *cmd_name, xcommand_t function); //removable command
qboolean Cmd_AddCommand (char *cmd_name, xcommand_t function);
// called by the init functions of other parts of the program to
// register commands and functions to call for them.
// The cmd_name is referenced later, so it should not be in temp memory