From 3f92bea422d56f26ce2a4acbe236a34484711ea9 Mon Sep 17 00:00:00 2001 From: divverent Date: Mon, 16 Mar 2009 12:26:23 +0000 Subject: [PATCH] add an option -fs_homebase to override homebase path in the game pack (for use by gamepacks so they need no specific q3map2 change to use the right home dir) git-svn-id: svn://svn.icculus.org/netradiant/trunk@221 61c419a2-8eb2-4b30-bcec-8cead039b335 --- tools/quake3/q3map2/path_init.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/tools/quake3/q3map2/path_init.c b/tools/quake3/q3map2/path_init.c index 186102b0..538502d1 100644 --- a/tools/quake3/q3map2/path_init.c +++ b/tools/quake3/q3map2/path_init.c @@ -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 ) -- 2.39.2