From e22e6169c9ebd75741a3ff816f1203744b12793b Mon Sep 17 00:00:00 2001 From: Garux Date: Thu, 16 Sep 2021 15:26:55 +0300 Subject: [PATCH] * -fs_basegame gamename: Overrides default game directory name (e.g. Q3A uses 'baseq3', OpenArena 'baseoa', so -game quake3 -fs_basegame baseoa for OA ) --- docs/Complete_list_of_command_line_parameters.htm | 3 ++- tools/quake3/q3map2/help.cpp | 3 ++- tools/quake3/q3map2/path_init.cpp | 13 ++++++++++++- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/docs/Complete_list_of_command_line_parameters.htm b/docs/Complete_list_of_command_line_parameters.htm index 960c785b..afbfcae9 100644 --- a/docs/Complete_list_of_command_line_parameters.htm +++ b/docs/Complete_list_of_command_line_parameters.htm @@ -108,7 +108,8 @@ td.formatted_questions ol { margin-top: 0px; margin-bottom: 0px; }
  • -connect address: Talk to a NetRadiant instance using a specific XML based protocol
  • -force: Allow reading some broken/unsupported BSP files e.g. when decompiling, may also crash
  • -fs_basepath path: Sets the given path as main directory of the game (can be used more than once to look in multiple paths)
  • -
  • -fs_game gamename: Sets a different game directory name (default for Q3A: baseq3)
  • +
  • -fs_game gamename: Sets extra game directory name to additionally load mod's resources from at higher priority (by default for Q3A 'baseq3' is loaded, -fs_game cpma will also load 'cpma'; can be used more than once)
  • +
  • -fs_basegame gamename: Overrides default game directory name (e.g. Q3A uses 'baseq3', OpenArena 'baseoa', so -game quake3 -fs_basegame baseoa for OA )
  • -fs_homebase dir: Specifies where the user home directory name is on Linux (default for Q3A: .q3a)
  • -game gamename: Load settings for the given game (default: quake3)
  • -subdivisions F: multiplier for patch subdivisions quality
  • diff --git a/tools/quake3/q3map2/help.cpp b/tools/quake3/q3map2/help.cpp index cd3a63ed..b0f03665 100644 --- a/tools/quake3/q3map2/help.cpp +++ b/tools/quake3/q3map2/help.cpp @@ -385,7 +385,8 @@ void HelpCommon() {"-force", "Allow reading some broken/unsupported BSP files e.g. when decompiling, may also crash"}, {"-fs_basepath ", "Sets the given path as main directory of the game (can be used more than once to look in multiple paths)"}, {"-fs_forbiddenpath ", "Pattern to ignore directories, pk3, and pk3dir; example pak?.pk3 (can be used more than once to look for multiple patterns)"}, - {"-fs_game ", "Sets a different game directory name (default for Q3A: baseq3, can be used more than once)"}, + {"-fs_game ", "Sets extra game directory name to additionally load mod's resources from at higher priority (by default for Q3A 'baseq3' is loaded, -fs_game cpma will also load 'cpma'; can be used more than once)"}, + {"-fs_basegame ", "Overrides default game directory name (e.g. Q3A uses 'baseq3', OpenArena 'baseoa', so -game quake3 -fs_basegame baseoa for OA )"}, {"-fs_home ", "Specifies where the user home directory is on Linux"}, {"-fs_homebase ", "Specifies game home directory relative to user home directory on Linux (default for Q3A: .q3a)"}, {"-fs_homepath ", "Sets the given path as the game home directory name (fs_home + fs_homebase)"}, diff --git a/tools/quake3/q3map2/path_init.cpp b/tools/quake3/q3map2/path_init.cpp index 2d5567fd..871f9f45 100644 --- a/tools/quake3/q3map2/path_init.cpp +++ b/tools/quake3/q3map2/path_init.cpp @@ -359,6 +359,7 @@ void AddPakPath( char *path ){ void InitPaths( int *argc, char **argv ){ int i, j, k; char temp[ MAX_OS_PATH ]; + const char *baseGame = nullptr; /* note it */ @@ -425,6 +426,16 @@ void InitPaths( int *argc, char **argv ){ argv[ i ] = NULL; } + /* -fs_basegame */ + else if ( striEqual( argv[ i ], "-fs_basegame" ) ) { + if ( ++i >= *argc || !argv[ i ] ) { + Error( "Out of arguments: No path specified after %s.", argv[ i - 1 ] ); + } + argv[ i - 1 ] = NULL; + baseGame = argv[ i ]; + argv[ i ] = NULL; + } + /* -fs_home */ else if ( striEqual( argv[ i ], "-fs_home" ) ) { if ( ++i >= *argc || !argv[ i ] ) { @@ -481,7 +492,7 @@ void InitPaths( int *argc, char **argv ){ *argc = k; /* add standard game path */ - AddGamePath( g_game->gamePath ); + AddGamePath( baseGame == nullptr? g_game->gamePath : baseGame ); /* if there is no base path set, figure it out */ if ( numBasePaths == 0 ) {