=================== CL_ForwardCommandToServer adds the current command line as a clientCommand things like godmode, noclip, etc, are commands directed to the server, so when they are typed in at the console, they will need to be forwarded. =================== */
| 296 | =================== |
| 297 | */ |
| 298 | void CL_ForwardCommandToServer( void ) { |
| 299 | const char *cmd; |
| 300 | char string[MAX_STRING_CHARS]; |
| 301 | |
| 302 | cmd = Cmd_Argv(0); |
| 303 | |
| 304 | // ignore key up commands |
| 305 | if ( cmd[0] == '-' ) { |
| 306 | return; |
| 307 | } |
| 308 | |
| 309 | if ( cls.state != CA_ACTIVE || cmd[0] == '+' ) { |
| 310 | Com_Printf ("Unknown command \"%s\"\n", cmd); |
| 311 | return; |
| 312 | } |
| 313 | |
| 314 | if ( Cmd_Argc() > 1 ) { |
| 315 | Com_sprintf( string, sizeof(string), "%s %s", cmd, Cmd_Args() ); |
| 316 | } else { |
| 317 | Q_strncpyz( string, cmd, sizeof(string) ); |
| 318 | } |
| 319 | |
| 320 | CL_AddReliableCommand( string ); |
| 321 | } |
| 322 | |
| 323 | |
| 324 | /* |
no test coverage detected