...
 
Commits (4)
......@@ -709,6 +709,11 @@ int BSPMain( int argc, char **argv ){
portalFilePath[0] = 0;
surfaceFilePath[0] = 0;
if ( argc >= 2 && !strcmp( argv[ 1 ], "-bsp" ) ) {
Sys_Printf( "-bsp argument unnecessary\n" );
argv++;
argc--;
}
/* note it */
Sys_Printf( "--- BSP ---\n" );
......@@ -1010,9 +1015,6 @@ int BSPMain( int argc, char **argv ){
i++;
Sys_Printf( "Use %s as surface file\n", surfaceFilePath );
}
else if ( !strcmp( argv[ i ], "-bsp" ) ) {
Sys_Printf( "-bsp argument unnecessary\n" );
}
else{
Sys_FPrintf( SYS_WRN, "WARNING: Unknown option \"%s\"\n", argv[ i ] );
}
......
......@@ -83,7 +83,7 @@ int AnalyzeBSPMain( int argc, char **argv ){
/* arg checking */
if ( argc < 1 ) {
if ( argc < 2 ) {
Sys_Printf( "Usage: q3map -analyze [-lumpswap] [-v] <mapname>\n" );
return 0;
}
......
......@@ -151,7 +151,7 @@ int ConvertBSPMain( int argc, char **argv ){
force_map = qfalse;
/* arg checking */
if ( argc < 1 ) {
if ( argc < 2 ) {
Sys_Printf( "Usage: q3map -convert [-format <ase|obj|map_bp|map>] [-shadersasbitmap|-lightmapsastexcoord|-deluxemapsastexcoord] [-readbsp|-readmap [-meta|-patchmeta]] [-v] <mapname>\n" );
return 0;
}
......
......@@ -90,7 +90,7 @@ void ExportEntities( void ){
int ExportEntitiesMain( int argc, char **argv ){
/* arg checking */
if ( argc < 1 ) {
if ( argc < 2 ) {
Sys_Printf( "Usage: q3map -exportents [-v] <mapname>\n" );
return 0;
}
......@@ -109,4 +109,4 @@ int ExportEntitiesMain( int argc, char **argv ){
/* return to sender */
return 0;
}
\ No newline at end of file
}
This diff is collapsed.
......@@ -153,7 +153,7 @@ void ExportLightmaps( void ){
int ExportLightmapsMain( int argc, char **argv ){
/* arg checking */
if ( argc < 1 ) {
if ( argc < 2 ) {
Sys_Printf( "Usage: q3map -export [-v] <mapname>\n" );
return 0;
}
......@@ -188,7 +188,7 @@ int ImportLightmapsMain( int argc, char **argv ){
/* arg checking */
if ( argc < 1 ) {
if ( argc < 2 ) {
Sys_Printf( "Usage: q3map -import [-v] <mapname>\n" );
return 0;
}
......
......@@ -122,14 +122,16 @@ int main( int argc, char **argv ){
/* -help */
if ( !strcmp( argv[ i ], "-h" ) || !strcmp( argv[ i ], "--help" )
|| !strcmp( argv[ i ], "-help" ) ) {
HelpMain(argv[i+1]);
HelpMain( ( i + 1 < argc ) ? argv[ i + 1 ] : NULL );
return 0;
}
/* -connect */
if ( !strcmp( argv[ i ], "-connect" ) ) {
argv[ i ] = NULL;
i++;
if ( ++i >= argc || !argv[ i ] ) {
Error( "Out of arguments: No address specified after %s", argv[ i - 1 ] );
}
argv[ i - 1 ] = NULL;
Broadcast_Setup( argv[ i ] );
argv[ i ] = NULL;
}
......@@ -156,8 +158,10 @@ int main( int argc, char **argv ){
/* patch subdivisions */
else if ( !strcmp( argv[ i ], "-subdivisions" ) ) {
argv[ i ] = NULL;
i++;
if ( ++i >= argc || !argv[ i ] ) {
Error( "Out of arguments: No value specified after %s", argv[ i - 1 ] );
}
argv[ i - 1 ] = NULL;
patchSubdivisions = atoi( argv[ i ] );
argv[ i ] = NULL;
if ( patchSubdivisions <= 0 ) {
......@@ -167,8 +171,10 @@ int main( int argc, char **argv ){
/* threads */
else if ( !strcmp( argv[ i ], "-threads" ) ) {
argv[ i ] = NULL;
i++;
if ( ++i >= argc || !argv[ i ] ) {
Error( "Out of arguments: No value specified after %s", argv[ i - 1 ] );
}
argv[ i - 1 ] = NULL;
numthreads = atoi( argv[ i ] );
argv[ i ] = NULL;
}
......
......@@ -470,7 +470,7 @@ void InitPaths( int *argc, char **argv ){
/* -game */
if ( strcmp( argv[ i ], "-game" ) == 0 ) {
if ( ++i >= *argc ) {
if ( ++i >= *argc || !argv[ i ] ) {
Error( "Out of arguments: No game specified after %s", argv[ i - 1 ] );
}
argv[ i - 1 ] = NULL;
......@@ -483,7 +483,7 @@ void InitPaths( int *argc, char **argv ){
/* -fs_forbiddenpath */
else if ( strcmp( argv[ i ], "-fs_forbiddenpath" ) == 0 ) {
if ( ++i >= *argc ) {
if ( ++i >= *argc || !argv[ i ] ) {
Error( "Out of arguments: No path specified after %s.", argv[ i - 1 ] );
}
argv[ i - 1 ] = NULL;
......@@ -511,7 +511,7 @@ void InitPaths( int *argc, char **argv ){
/* -fs_basepath */
else if ( strcmp( argv[ i ], "-fs_basepath" ) == 0 ) {
if ( ++i >= *argc ) {
if ( ++i >= *argc || !argv[ i ] ) {
Error( "Out of arguments: No path specified after %s.", argv[ i - 1 ] );
}
argv[ i - 1 ] = NULL;
......@@ -521,7 +521,7 @@ void InitPaths( int *argc, char **argv ){
/* -fs_game */
else if ( strcmp( argv[ i ], "-fs_game" ) == 0 ) {
if ( ++i >= *argc ) {
if ( ++i >= *argc || !argv[ i ] ) {
Error( "Out of arguments: No path specified after %s.", argv[ i - 1 ] );
}
argv[ i - 1 ] = NULL;
......@@ -531,7 +531,7 @@ void InitPaths( int *argc, char **argv ){
/* -fs_home */
else if ( strcmp( argv[ i ], "-fs_home" ) == 0 ) {
if ( ++i >= *argc ) {
if ( ++i >= *argc || !argv[ i ] ) {
Error( "Out of arguments: No path specified after %s.", argv[ i - 1 ] );
}
argv[ i - 1 ] = NULL;
......@@ -548,7 +548,7 @@ void InitPaths( int *argc, char **argv ){
/* -fs_homebase */
else if ( strcmp( argv[ i ], "-fs_homebase" ) == 0 ) {
if ( ++i >= *argc ) {
if ( ++i >= *argc || !argv[ i ] ) {
Error( "Out of arguments: No path specified after %s.", argv[ i - 1 ] );
}
argv[ i - 1 ] = NULL;
......@@ -558,7 +558,7 @@ void InitPaths( int *argc, char **argv ){
/* -fs_homepath - sets both of them */
else if ( strcmp( argv[ i ], "-fs_homepath" ) == 0 ) {
if ( ++i >= *argc ) {
if ( ++i >= *argc || !argv[ i ] ) {
Error( "Out of arguments: No path specified after %s.", argv[ i - 1 ] );
}
argv[ i - 1 ] = NULL;
......@@ -569,7 +569,7 @@ void InitPaths( int *argc, char **argv ){
/* -fs_pakpath */
else if ( strcmp( argv[ i ], "-fs_pakpath" ) == 0 ) {
if ( ++i >= *argc ) {
if ( ++i >= *argc || !argv[ i ] ) {
Error( "Out of arguments: No path specified after %s.", argv[ i - 1 ] );
}
argv[ i - 1 ] = NULL;
......
......@@ -1142,7 +1142,7 @@ int VisMain( int argc, char **argv ){
}
else if ( !strcmp( argv[ i ], "-v" ) ) {
debugCluster = qtrue;
Sys_Printf( "Extra verbous mode enabled\n" );
Sys_Printf( "Extra verbose mode enabled\n" );
}
else if ( !strcmp( argv[i],"-tmpin" ) ) {
strcpy( inbase, "/tmp" );
......