From d46404210bc8f648c2f2687203565836fdc1b344 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sat, 28 Apr 2018 15:22:13 +0200 Subject: [PATCH] q3map2: disable magic path guess --- tools/quake3/q3map2/help.c | 1 + tools/quake3/q3map2/path_init.c | 12 +++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tools/quake3/q3map2/help.c b/tools/quake3/q3map2/help.c index 519a46e1..a4d89047 100644 --- a/tools/quake3/q3map2/help.c +++ b/tools/quake3/q3map2/help.c @@ -354,6 +354,7 @@ void HelpCommon() {"-fs_homebase ", "Specifies where the user home directory name is on Linux (default for Q3A: .q3a)"}, {"-fs_homepath ", "Sets the given path as home directory name"}, {"-fs_nobasepath", "Do not load base paths in VFS"}, + {"-fs_nomagicpath", "Do not try to guess base path magically"}, {"-fs_nohomepath", "Do not load home path in VFS"}, {"-fs_pakpath ", "Specify a package directory (can be used more than once to look in multiple paths)"}, {"-game ", "Load settings for the given game (default: quake3)"}, diff --git a/tools/quake3/q3map2/path_init.c b/tools/quake3/q3map2/path_init.c index 0520d332..a13821e9 100644 --- a/tools/quake3/q3map2/path_init.c +++ b/tools/quake3/q3map2/path_init.c @@ -409,6 +409,7 @@ void InitPaths( int *argc, char **argv ){ int noBasePath = 0; int noHomePath = 0; + int noMagicPath = 0; /* note it */ Sys_FPrintf( SYS_VRB, "--- InitPaths ---\n" ); @@ -462,6 +463,12 @@ void InitPaths( int *argc, char **argv ){ argv[ i ] = NULL; } + /* -fs_nomagicpath */ + else if ( strcmp( argv[ i ], "-fs_nomagicpath") == 0) { + noMagicPath = 1; + argv[ i ] = NULL; + } + /* -fs_basepath */ else if ( strcmp( argv[ i ], "-fs_basepath" ) == 0 ) { if ( ++i >= *argc ) { @@ -528,7 +535,6 @@ void InitPaths( int *argc, char **argv ){ AddPakPath( argv[ i ] ); argv[ i ] = NULL; } - } /* remove processed arguments */ @@ -545,8 +551,8 @@ void InitPaths( int *argc, char **argv ){ /* add standard game path */ AddGamePath( game->gamePath ); - /* if there is no base path set, figure it out */ - if ( numBasePaths == 0 && noBasePath == 0 ) { + /* if there is no base path set, figure it out unless fs_nomagicpath is set */ + if ( numBasePaths == 0 && noBasePath == 0 && noMagicPath == 0 ) { /* this is another crappy replacement for SetQdirFromPath() */ len2 = strlen( game->magic ); for ( i = 0; i < *argc && numBasePaths == 0; i++ ) -- 2.39.2