launcher/launcher.cpp
void RemoveSpuriousGameParameters()
{
	// Find the last -game parameter.
	int nGameArgs = 0;
	char lastGameArg[MAX_PATH];
	for ( int i=0; i < CommandLine()->ParmCount()-1; i++ )
	{
		if ( Q_stricmp( CommandLine()->GetParm( i ), "-game" ) == 0 )
		{
			Q_snprintf( lastGameArg, sizeof( lastGameArg ), "\"%s\"", CommandLine()->GetParm( i+1 ) );
			++nGameArgs;
			++i;
		}
	}

	// We only care if > 1 was specified.
	if ( nGameArgs > 1 )
	{
		CommandLine()->RemoveParm( "-game" );
		CommandLine()->AppendParm( "-game", lastGameArg );
	}
}
// Remove all but the last -game parameter.
// This is for mods based off something other than Half-Life 2 (like HL2MP mods).
// The Steam UI does 'steam -applaunch 320 -game c:\steam\steamapps\sourcemods\modname', but applaunch inserts
// its own -game parameter, which would supercede the one we really want if we didn't intercede here.
Remove all but the last -game parameter.
This is for mods based off something other than Half-Life 2 (like HL2MP mods).
The Steam UI does 'steam -applaunch 320 -game c:\steam\steamapps\sourcemods\modname', but applaunch inserts
its own -game parameter, which would supercede the one we really want if we didn't intercede here.
Remove all but the last - game parameter . This is for mods based off something other than Half - Life 2 ( like HL2MP mods ) . The Steam UI does ' steam - applaunch 320 - game c : \ steam \ steamapps \ sourcemods \ modname ' but applaunch inserts its own - game parameter which would supercede the one we really want if we didn ' t intercede here .
void RemoveSpuriousGameParameters()
{
	int nGameArgs = 0;
	char lastGameArg[MAX_PATH];
	for ( int i=0; i < CommandLine()->ParmCount()-1; i++ )
	{
		if ( Q_stricmp( CommandLine()->GetParm( i ), "-game" ) == 0 )
		{
			Q_snprintf( lastGameArg, sizeof( lastGameArg ), "\"%s\"", CommandLine()->GetParm( i+1 ) );
			++nGameArgs;
			++i;
		}
	}
	if ( nGameArgs > 1 )
	{
		CommandLine()->RemoveParm( "-game" );
		CommandLine()->AppendParm( "-game", lastGameArg );
	}
}
void RemoveSpuriousGameParameters ( ) { int nGameArgs = 0 ; char lastGameArg [ MAX_PATH ] ; for ( int i = 0 ; i < CommandLine ( ) -> ParmCount ( ) - 1 ; i ++ ) { if ( Q_stricmp ( CommandLine ( ) -> GetParm ( i ) , " " ) == 0 ) { Q_snprintf ( lastGameArg , sizeof ( lastGameArg ) , " \" \" " , CommandLine ( ) -> GetParm ( i + 1 ) ) ; ++ nGameArgs ; ++ i ; } } if ( nGameArgs > 1 ) { CommandLine ( ) -> RemoveParm ( " " ) ; CommandLine ( ) -> AppendParm ( " " , lastGameArg ) ; } }
Remove all but the last -game parameter.
Remove all but the last - game parameter .
// Find the last -game parameter. // We only care if > 1 was specified.