qboolean G_ConsoleCommand( void ) { gentity_t *ent; qboolean result; result = false; try { if ( dedicated->integer ) { const char *cmd; cmd = gi.argv( 0 ); if ( stricmp( cmd, "say" ) == 0 ) { G_Say( NULL, false, false ); result = true; } } if ( !result ) { ent = &g_entities[ 0 ]; result = G_ProcessClientCommand( ent ); } } catch( const char *error ) { G_ExitWithError( error ); } return result; }
qboolean G_ConsoleCommand ( void ) { gentity_t *ent; qboolean result; consolecmd_t *cmds; const char *cmd; result = qfalse; try { ent = &g_entities[ 0 ]; cmd = gi.Argv( 0 ); for( cmds = G_ConsoleCmds; cmds->command != NULL; cmds++ ) { if( !Q_stricmp( cmd, cmds->command ) ) { return cmds->func( ent ); } } result = G_ProcessClientCommand( ent ); } catch( const char *error ) { G_ExitWithError( error ); } return result; }
void G_ClientCommand( gentity_t *ent ) { try { if ( ent && !G_ProcessClientCommand( ent ) ) { // anything that doesn't match a command will be a chat G_Say( ent, false, true ); } } catch( const char *error ) { G_ExitWithError( error ); } }