]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
add an option -fs_homebase to override homebase path in the game pack (for use by...
authordivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Mon, 16 Mar 2009 12:26:23 +0000 (12:26 +0000)
committerdivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Mon, 16 Mar 2009 12:26:23 +0000 (12:26 +0000)
git-svn-id: svn://svn.icculus.org/netradiant/trunk@221 61c419a2-8eb2-4b30-bcec-8cead039b335

tools/quake3/q3map2/path_init.c

index 186102b0f16bb06e282435ccfd64d643b4c5bbb5..538502d162219608122f13e8fd5e0736ecc97481 100644 (file)
@@ -49,7 +49,7 @@ int                                           numBasePaths;
 char                                   *basePaths[ MAX_BASE_PATHS ];
 int                                            numGamePaths;
 char                                   *gamePaths[ MAX_GAME_PATHS ];
-
+char                                   *homeBasePath = NULL;
 
 
 /*
@@ -378,6 +378,16 @@ void InitPaths( int *argc, char **argv )
                        AddGamePath( argv[ i ] );
                        argv[ i ] = NULL;
                }
+               
+               /* -fs_nohomebase */
+               else if( strcmp( argv[ i ], "-fs_homebase" ) == 0 )
+               {
+                       if( ++i >= *argc )
+                               Error( "Out of arguments: No path specified after %s.", argv[ i - 1 ] );
+                       argv[ i - 1 ] = NULL;
+                       homeBasePath = argv[i];
+                       argv[ i ] = NULL;
+               }
        }
        
        /* remove processed arguments */
@@ -433,7 +443,10 @@ void InitPaths( int *argc, char **argv )
        }
        
        /* this only affects unix */
-       AddHomeBasePath( game->homeBasePath );
+       if(homeBasePath)
+               AddHomeBasePath( homeBasePath );
+       else
+               AddHomeBasePath( game->homeBasePath );
        
        /* initialize vfs paths */
        if( numBasePaths > MAX_BASE_PATHS )