diff options
author | M. Kristall <mkpdev@gmail.com> | 2009-10-03 12:05:47 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:15:40 +0000 |
commit | c9006304896cd95d989f68d5b103702d51fdf7bb (patch) | |
tree | c4d3e61c40fb7e1c72cc6858778126b3a4648cbd /src/cgame/cg_consolecmds.c | |
parent | ae0a3343c5e6ce341896e0c0204dc385bc682e6f (diff) |
* (bug 3379) !adjustban command to change reason and duration of bans (flag b)
* (bug 3746) Lookup table for UI commands (Ben Millwood)
* and some other refactoring
* Fix a couple null dereferences introduced in 1120
Diffstat (limited to 'src/cgame/cg_consolecmds.c')
-rw-r--r-- | src/cgame/cg_consolecmds.c | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/src/cgame/cg_consolecmds.c b/src/cgame/cg_consolecmds.c index 697b0e98..47aadece 100644 --- a/src/cgame/cg_consolecmds.c +++ b/src/cgame/cg_consolecmds.c @@ -188,14 +188,14 @@ static void CG_TellAttacker_f( void ) trap_SendClientCommand( command ); } -typedef struct +static void CG_UIMenu_f( void ) { - char *cmd; - void (*function)( void ); -} consoleCommand_t; + trap_SendConsoleCommand( va( "menu %s\n", CG_Argv( 1 ) ) ); +} static consoleCommand_t commands[ ] = { + { "ui_menu", CG_UIMenu_f }, { "testgun", CG_TestGun_f }, { "testmodel", CG_TestModel_f }, { "nextframe", CG_TestModelNextFrame_f }, @@ -233,19 +233,10 @@ Cmd_Argc() / Cmd_Argv() qboolean CG_ConsoleCommand( void ) { const char *cmd; - const char *arg1; int i; cmd = CG_Argv( 0 ); - // ugly hacky special case - if( !Q_stricmp( cmd, "ui_menu" ) ) - { - arg1 = CG_Argv( 1 ); - trap_SendConsoleCommand( va( "menu %s\n", arg1 ) ); - return qtrue; - } - for( i = 0; i < sizeof( commands ) / sizeof( commands[ 0 ] ); i++ ) { if( !Q_stricmp( cmd, commands[ i ].cmd ) ) @@ -285,6 +276,11 @@ void CG_InitConsoleCommands( void ) trap_AddCommand( "ui_messagemode4" ); trap_AddCommand( "say" ); trap_AddCommand( "say_team" ); + trap_AddCommand( "vsay" ); + trap_AddCommand( "vsay_team" ); + trap_AddCommand( "vsay_local" ); + trap_AddCommand( "m" ); + trap_AddCommand( "mt" ); trap_AddCommand( "tell" ); trap_AddCommand( "give" ); trap_AddCommand( "god" ); @@ -293,28 +289,22 @@ void CG_InitConsoleCommands( void ) trap_AddCommand( "team" ); trap_AddCommand( "follow" ); trap_AddCommand( "levelshot" ); - trap_AddCommand( "addbot" ); trap_AddCommand( "setviewpos" ); trap_AddCommand( "callvote" ); trap_AddCommand( "vote" ); trap_AddCommand( "callteamvote" ); trap_AddCommand( "teamvote" ); - trap_AddCommand( "stats" ); trap_AddCommand( "class" ); trap_AddCommand( "build" ); trap_AddCommand( "buy" ); trap_AddCommand( "sell" ); trap_AddCommand( "reload" ); + trap_AddCommand( "boost" ); trap_AddCommand( "itemact" ); trap_AddCommand( "itemdeact" ); trap_AddCommand( "itemtoggle" ); trap_AddCommand( "destroy" ); trap_AddCommand( "deconstruct" ); - trap_AddCommand( "menu" ); - trap_AddCommand( "ui_menu" ); - trap_AddCommand( "mapRotation" ); - trap_AddCommand( "stopMapRotation" ); - trap_AddCommand( "advanceMapRotation" ); - trap_AddCommand( "alienWin" ); - trap_AddCommand( "humanWin" ); + trap_AddCommand( "ignore" ); + trap_AddCommand( "unignore" ); } |