MCPcopy Create free account
hub / github.com/JACoders/OpenJK / Com_AddStartupCommands

Function Com_AddStartupCommands

code/qcommon/common.cpp:449–469  ·  view source on GitHub ↗

================= Com_AddStartupCommands Adds command line parameters as script statements Commands are seperated by + signs Returns qtrue if any late commands were added, which will keep the demoloop from immediately starting ================= */

Source from the content-addressed store, hash-verified

447=================
448*/
449qboolean Com_AddStartupCommands( void ) {
450 int i;
451 qboolean added;
452
453 added = qfalse;
454 // quote every token, so args with semicolons can work
455 for (i=0 ; i < com_numConsoleLines ; i++) {
456 if ( !com_consoleLines[i] || !com_consoleLines[i][0] ) {
457 continue;
458 }
459
460 // set commands won't override menu startup
461 if ( Q_stricmpn( com_consoleLines[i], "set", 3 ) ) {
462 added = qtrue;
463 }
464 Cbuf_AddText( com_consoleLines[i] );
465 Cbuf_AddText( "\n" );
466 }
467
468 return added;
469}
470
471
472//============================================================================

Callers 1

Com_InitFunction · 0.70

Calls 2

Q_stricmpnFunction · 0.85
Cbuf_AddTextFunction · 0.70

Tested by

no test coverage detected