Skip to content

Commit

Permalink
Added Con_GetCommand()
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jun 23, 2003
1 parent 195618d commit fcf2d37
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions doomsday/Include/con_console.h
Expand Up @@ -37,6 +37,7 @@ void Con_AddCommand(ccmd_t *cmd);
void Con_AddVariable(cvar_t *var);
void Con_AddCommandList(ccmd_t *cmdlist);
void Con_AddVariableList(cvar_t *varlist);
ccmd_t *Con_GetCommand(const char *name);
void Con_UpdateKnownWords(void);
void Con_Ticker(void);
boolean Con_Responder(event_t *event);
Expand Down
16 changes: 15 additions & 1 deletion doomsday/Src/con_console.c
Expand Up @@ -855,6 +855,20 @@ void Con_AddCommand(ccmd_t *cmd)
//Con_UpdateKnownWords();
}

/*
* Returns a pointer to the ccmd_t with the specified name, or NULL.
*/
ccmd_t *Con_GetCommand(const char *name)
{
int i;

for(i = 0; i < numCCmds; i++)
{
if(!stricmp(ccmds[i].name, name)) return &ccmds[i];
}
return NULL;
}

void Con_AddVariableList(cvar_t *varlist)
{
for(; varlist->name; varlist++) Con_AddVariable(varlist);
Expand Down Expand Up @@ -982,7 +996,7 @@ void Con_Send(char *command, int silent)
Msg_WriteShort(len | (silent? 0x8000 : 0));
Msg_Write(command, len);
// Send it reliably.
Net_SendBuffer(0, SPF_RELIABLE);
Net_SendBuffer(0, SPF_ORDERED);
}

static void ClearExecBuffer()
Expand Down

0 comments on commit fcf2d37

Please sign in to comment.