Beispiel #1
0
/*
================
FS_InitFilesystem
================
*/
void FS_InitFilesystem(void)
{
	Cmd_AddCommand("path", FS_Path_f);
	Cmd_AddCommand("link", FS_Link_f);
	Cmd_AddCommand("dir", FS_Dir_f);

	//
	// basedir <path>
	// allows the game to run from outside the data tree
	//
	fs_basedir = Cvar_Get("basedir", ".", CVAR_NOSET);

	//
	// cddir <path>
	// Logically concatenates the cddir after the basedir for 
	// allows the game to run from outside the data tree
	//
	fs_cddir = Cvar_Get("cddir", "", CVAR_NOSET);
	if (fs_cddir->string[0])
		FS_AddGameDirectory(va("%s/"BASEDIRNAME, fs_cddir->string));

	//
	// start up with baseq2 by default
	//
	FS_AddGameDirectory(va("%s/"BASEDIRNAME, fs_basedir->string));

	// any set gamedirs will be freed up to here
	fs_base_searchpaths = fs_searchpaths;

	// check for game override
	fs_gamedirvar = Cvar_Get("game", "", CVAR_LATCH | CVAR_SERVERINFO);
	if (fs_gamedirvar->string[0])
		FS_SetGamedir(fs_gamedirvar->string);
}
Beispiel #2
0
void
FS_InitFilesystem(void)
{
	/* Register FS commands. */
	Cmd_AddCommand("path", FS_Path_f);
	Cmd_AddCommand("link", FS_Link_f);
	Cmd_AddCommand("dir", FS_Dir_f);

	/* basedir <path> Allows the game to run from outside the data tree.  */
	fs_basedir = Cvar_Get("basedir",
#ifdef SYSTEMWIDE
		SYSTEMDIR,
#else
		".",
#endif
		CVAR_NOSET);

	/* cddir <path> Logically concatenates the cddir after the basedir to
	   allow the game to run from outside the data tree. */
	fs_cddir = Cvar_Get("cddir", "", CVAR_NOSET);

	if (fs_cddir->string[0] != '\0')
	{
		FS_AddGameDirectory(va("%s/" BASEDIRNAME, fs_cddir->string));
	}

	/* Debug flag. */
	fs_debug = Cvar_Get("fs_debug", "0", 0);

	/* Game directory. */
	fs_gamedirvar = Cvar_Get("game", "", CVAR_LATCH | CVAR_SERVERINFO);

	/* Current directory. */
	fs_homepath = Cvar_Get("homepath", Sys_GetCurrentDirectory(), CVAR_NOSET);

	/* Add baseq2 to search path. */
	FS_AddGameDirectory(va("%s/" BASEDIRNAME, fs_basedir->string));
	FS_AddBinaryDirAsGameDirectory(BASEDIRNAME);
	FS_AddHomeAsGameDirectory(BASEDIRNAME);

	/* Any set gamedirs will be freed up to here. */
	fs_baseSearchPaths = fs_searchPaths;
	Q_strlcpy(fs_currentGame, BASEDIRNAME, sizeof(fs_currentGame));

	/* Check for game override. */
	if (fs_gamedirvar->string[0] != '\0')
	{
		FS_SetGamedir(fs_gamedirvar->string);
	}

	/* Create directory if it does not exist. */
	FS_CreatePath(fs_gamedir);

	Com_Printf("Using '%s' for writing.\n", fs_gamedir);
}
/**
 * \brief Sets the gamedir and path to a different directory.
 * \param[in] dir New game directory.
 */
PUBLIC void FS_SetGamedir( char *dir )
{
	searchpath_t	*next;

	if( strstr( dir, ".." ) || strstr( dir, "/" )
		|| strstr( dir, "\\" ) || strstr( dir, ":" ) )
	{
		Com_Printf( "Gamedir should be a single filename, not a path\n" );
		return;
	}

	//
	// free up any current game dir info
	//
	while( fs_searchpaths != fs_base_searchpaths )
	{
		if( fs_searchpaths->pack )
		{
			fclose( fs_searchpaths->pack->handle );
			Z_Free( fs_searchpaths->pack->files );
			Z_Free( fs_searchpaths->pack );
		}
		next = fs_searchpaths->next;
		Z_Free( fs_searchpaths );
		fs_searchpaths = next;
	}

	//
	// flush all data, so it will be forced to reload
	//
//	if (dedicated && !dedicated->value)
//		Cbuf_AddText ("vid_restart\nsnd_restart\n");

	com_snprintf( fs_gamedir, sizeof(fs_gamedir), "%s%c%s", fs_basedir->string, PATH_SEP, dir);

	if( ! strcmp( dir, BASE_DIRECTORY ) || (*dir == 0) )
	{
		Cvar_Get( "gamedir", "", CVAR_SERVERINFO | CVAR_ROM );
		Cvar_Get( "game", "", CVAR_LATCH | CVAR_SERVERINFO );
	}
	else
	{
		Cvar_Get( "gamedir", dir, CVAR_SERVERINFO | CVAR_ROM );
		if( fs_cddir->string[ 0 ] )
		{
			FS_AddGameDirectory( va( "%s%c%s", fs_cddir->string, PATH_SEP, dir ) );
		}
		FS_AddGameDirectory( va("%s%c%s", fs_basedir->string, PATH_SEP, dir) );
	}
}
Beispiel #4
0
/*
================
FS_SetGamedir

Sets the gamedir and path to a different directory.
================
*/
void FS_SetGamedir (const char *dir)
{
	searchpath_t	*next;

	if (strstr(dir, "..") || strchr(dir, '/')
		|| strchr(dir, '\\') || strchr(dir, ':') )
	{
		Com_Printf ("Gamedir '%s' should be a single filename, not a path\n", LOG_GENERAL, dir);
		return;
	}

	//
	// free up any current game dir info
	//
	while (fs_searchpaths != fs_base_searchpaths)
	{
		if (fs_searchpaths->pack)
		{
			fclose (fs_searchpaths->pack->h.handle);
			//Z_Free (fs_searchpaths->pack->files);
			rbdestroy (fs_searchpaths->pack->rb);
			Z_Free (fs_searchpaths->pack);
		}
		next = fs_searchpaths->next;
		Z_Free (fs_searchpaths);
		fs_searchpaths = next;
	}

	//
	// flush all data, so it will be forced to reload
	//

	FS_FlushCache();

#ifndef DEDICATED_ONLY
#ifndef NO_SERVER
	if (!dedicated->intvalue)
	{
#endif
		//Cbuf_AddText ("vid_restart\nsnd_restart\n");
		Cmd_ExecuteString ("vid_restart");
		Cmd_ExecuteString ("snd_restart");
#ifndef NO_SERVER
	}
#endif
#endif

	if (!strcmp(dir,BASEDIRNAME) || (*dir == 0))
	{
		Com_sprintf (fs_gamedir, sizeof(fs_gamedir), "%s/%s", fs_basedir->string, BASEDIRNAME);
		Cvar_FullSet ("gamedir", "", CVAR_SERVERINFO|CVAR_NOSET);
		Cvar_FullSet ("game", "", CVAR_LATCH|CVAR_SERVERINFO);
	}
	else
	{
		Com_sprintf (fs_gamedir, sizeof(fs_gamedir), "%s/%s", fs_basedir->string, dir);
		Cvar_FullSet ("gamedir", dir, CVAR_SERVERINFO|CVAR_NOSET);
		FS_AddGameDirectory (va("%s/%s", fs_basedir->string, dir) );
	}
}
Beispiel #5
0
void FS_ReloadPAKs (void)
{
	const char		*dir;
	searchpath_t	*next;

	//
	// free up any current game dir info
	//
	while (fs_searchpaths != fs_base_searchpaths)
	{
		if (fs_searchpaths->pack)
		{
			fclose (fs_searchpaths->pack->h.handle);
			//Z_Free (fs_searchpaths->pack->files);
			//RB_Purge (fs_searchpaths->pack->rb);
			rbdestroy (fs_searchpaths->pack->rb);
			Z_Free (fs_searchpaths->pack);
		}
		next = fs_searchpaths->next;
		Z_Free (fs_searchpaths);
		fs_searchpaths = next;
	}

	dir = Cvar_VariableString ("gamedir");

	if (dir[0] && strcmp(dir, BASEDIRNAME))
		FS_AddGameDirectory (va("%s/%s", fs_basedir->string, dir) );
}
Beispiel #6
0
void TEST_Init (void)
{
	try {
		com_aliasSysPool  = Mem_CreatePool("Common: Alias system");
		com_cmdSysPool    = Mem_CreatePool("Common: Command system");
		com_cmodelSysPool = Mem_CreatePool("Common: Collision model");
		com_cvarSysPool   = Mem_CreatePool("Common: Cvar system");
		com_fileSysPool   = Mem_CreatePool("Common: File system");
		com_genericPool   = Mem_CreatePool("Generic");

		Mem_Init();
		Cbuf_Init();
		Cmd_Init();
		Cvar_Init();
		FS_InitFilesystem(true);
		FS_AddGameDirectory("./unittest", false);
		FS_AddHomeAsGameDirectory("unittest", true);
		Swap_Init();
		SV_Init();
		NET_Init();

		FS_ExecAutoexec();

		OBJZERO(csi);
	} catch (comDrop_t const&) {
		Sys_Error("Error during initialization");
	}

	http_timeout = Cvar_Get("noname");
	http_proxy = Cvar_Get("noname");
	hwclass = Cvar_Get("hwclass", "5");
}
Beispiel #7
0
void TEST_Init (void)
{
	Com_SetExceptionCallback(Test_InitError);

	com_aliasSysPool = Mem_CreatePool("Common: Alias system");
	com_cmdSysPool = Mem_CreatePool("Common: Command system");
	com_cmodelSysPool = Mem_CreatePool("Common: Collision model");
	com_cvarSysPool = Mem_CreatePool("Common: Cvar system");
	com_fileSysPool = Mem_CreatePool("Common: File system");
	com_genericPool = Mem_CreatePool("Generic");

	Mem_Init();
	Cbuf_Init();
	Cmd_Init();
	Cvar_Init();
	FS_InitFilesystem(qtrue);
	FS_AddGameDirectory("./unittest", qfalse);
	Swap_Init();
	SV_Init();
	NET_Init();

	FS_ExecAutoexec();

	OBJZERO(csi);

	Com_SetExceptionCallback(Test_RunError);

	http_timeout = Cvar_Get("noname", "", 0, NULL);
	http_proxy = Cvar_Get("noname", "", 0, NULL);
}
Beispiel #8
0
/*
 * Use ~/.quake2/dir as fs_gamedir.
 */
void
FS_AddHomeAsGameDirectory(char *dir)
{
	char *home;
	char gdir[MAX_OSPATH];
	size_t len;

	home = Sys_GetHomeDir();

	if (home == NULL)
	{
		return;
	}

    len = snprintf(gdir, sizeof(gdir), "%s%s/", home, dir);
	FS_CreatePath(gdir);

	if ((len > 0) && (len < sizeof(gdir)) && (gdir[len - 1] == '/'))
	{
		gdir[len - 1] = 0;
	}

	Q_strlcpy(fs_gamedir, gdir, sizeof(fs_gamedir));

	FS_AddGameDirectory(gdir);
}
/**
 * \brief Initialize file system.
 */
PUBLIC void FS_InitFilesystem( void )
{
    char path[1024];

	Cmd_AddCommand( "path", FS_Path_f );
	Cmd_AddCommand( "link", FS_Link_f );
	Cmd_AddCommand( "dir", FS_Dir_f );

	//
	// basedir <path>
	// allows the game to run from outside the data tree
	//
	fs_basedir = Cvar_Get( "basedir", ".", CVAR_ROM );

	//
	// cddir <path>
	// Logically concatenates the cddir after the basedir. This 
	// allows the game to run from outside the data tree.
	//
	fs_cddir = Cvar_Get( "cddir", "", CVAR_ROM );
	if( fs_cddir->string[ 0 ] )
	{
        com_snprintf( path, sizeof(path), "%s%c%s", fs_cddir->string, PATH_SEP, BASE_DIRECTORY );
		FS_AddGameDirectory( path );
	}

	//
	// start up with BASEDIRNAME by default
	//    
    com_snprintf( path, sizeof(path), "%s%c%s", fs_basedir->string, PATH_SEP, BASE_DIRECTORY );
    FS_AddGameDirectory( path ); 

	// any set gamedirs will be freed up to here
	fs_base_searchpaths = fs_searchpaths;

	// check for game override
	fs_gamedirvar = Cvar_Get( "game", "", CVAR_LATCH | CVAR_SERVERINFO );
	if( fs_gamedirvar->string[ 0 ] )
	{
		FS_SetGamedir( fs_gamedirvar->string );
	}
}
Beispiel #10
0
/*
=============
COM_AddAppDirectoryToSearchPath

=============
*/
void COM_AddAppDirectoryToSearchPath( const char *pszBaseDir, const char *appName )
{
	string	dir;

	if( !pszBaseDir || !appName )
	{
		MsgDev( D_ERROR, "COM_AddDirectorySearchPath: bad directory or appname\n" );
		return;
	}

	Q_snprintf( dir, sizeof( dir ), "%s/%s", pszBaseDir, appName );
	FS_AddGameDirectory( dir, FS_GAMEDIR_PATH );
}
Beispiel #11
0
void
FS_AddSystemwideGameDirectory(char *dir)
{
	char gdir[MAX_OSPATH];
	char *datadir = SYSTEMDIR;
	int len = snprintf(gdir, sizeof(gdir), "%s/%s/", datadir, dir);

	printf("Using %s to fetch paks\n", gdir);

	if ((len > 0) && (len < sizeof(gdir)) && (gdir[len - 1] == '/'))
	{
		gdir[len - 1] = 0;
	}

	FS_AddGameDirectory(gdir);
}
Beispiel #12
0
/*
================
FS_InitFilesystem
================
*/
void FS_InitFilesystem (void)
{
	Cmd_AddCommand ("path", FS_Path_f);
	Cmd_AddCommand ("link", FS_Link_f);
	Cmd_AddCommand ("dir", FS_Dir_f );

	//
	// basedir <path>
	// allows the game to run from outside the data tree
	//
	fs_basedir = Cvar_Get ("basedir", ".", CVAR_NOSET);

	//
	// cddir <path>
	// Logically concatenates the cddir after the basedir for 
	// allows the game to run from outside the data tree
	//
	fs_cddir = Cvar_Get ("cddir", "", CVAR_NOSET);
	if (fs_cddir->string[0])
		FS_AddGameDirectory (va("%s/"BASEDIRNAME, fs_cddir->string) );

	//
	// start up with baseq2 by default
	//
	FS_AddGameDirectory (va("%s/"BASEDIRNAME, fs_basedir->string) );
	
#ifdef ANDROID
    FS_AddGameDirectory(va("/sdcard/"BASEDIRNAME));
    FS_AddGameDirectory(va("/"BASEDIRNAME));
    FS_AddGameDirectory(va("/storage/emulated/0/"BASEDIRNAME));
    FS_AddGameDirectory(va("/data/data/com.example.quake2/files/"BASEDIRNAME));
    FS_AddGameDirectory(va("/storage/emulated/0/Android/data/com.example.quake2/files/"BASEDIRNAME));
    FS_AddGameDirectory(va("/sdcard/Android/data/com.example.quake2/files/"BASEDIRNAME));
#endif

	// any set gamedirs will be freed up to here
	fs_base_searchpaths = fs_searchpaths;
Com_Printf("search-path: %s", fs_base_searchpaths);
	// check for game override
	fs_gamedirvar = Cvar_Get ("game", "", CVAR_LATCH|CVAR_SERVERINFO);
	if (fs_gamedirvar->string[0])
		FS_SetGamedir (fs_gamedirvar->string);
}
Beispiel #13
0
/*
================
FS_InitFilesystem
================
*/
void FS_InitFilesystem (void)
{
	current_filename = "unknown";

	Cmd_AddCommand ("path", FS_Path_f);
	Cmd_AddCommand ("link", FS_Link_f);
	Cmd_AddCommand ("dir", FS_Dir_f );

	//r1: search for a file
	Cmd_AddCommand ("whereis", FS_WhereIs_f);

	//r1: allow manual cache flushing
	Cmd_AddCommand ("fsflushcache", FS_FlushCache);

	//r1: fs stats
	Cmd_AddCommand ("fs_stats", FS_Stats_f);

	//r1: binary tree filesystem cache
	FS_InitCache ();

	//r1: init fs cache
	//FS_FlushCache ();

	//
	// basedir <path>
	// allows the game to run from outside the data tree
	//
	fs_basedir = Cvar_Get ("basedir", ".", CVAR_NOSET);
	fs_cache = Cvar_Get ("fs_cache", "7", 0);
	fs_noextern = Cvar_Get ("fs_noextern", "0", 0);

	//
	// start up with baseq2 by default
	//
	FS_AddGameDirectory (va("%s/"BASEDIRNAME, fs_basedir->string) );

	// any set gamedirs will be freed up to here
	fs_base_searchpaths = fs_searchpaths;

	// check for game override
	fs_gamedirvar = Cvar_Get ("game", "", CVAR_LATCH|CVAR_SERVERINFO);
	if (fs_gamedirvar->string[0])
		FS_SetGamedir (fs_gamedirvar->string);
}
Beispiel #14
0
void FS_AddBinaryDirAsGameDirectory(const char* dir)
{
	char gdir[MAX_OSPATH];
	const char *datadir = Sys_GetBinaryDir();
	if(datadir[0] == '\0')
	{
		return;
	}
	int len = snprintf(gdir, sizeof(gdir), "%s%s/", datadir, dir);

	printf("Using binary dir %s to fetch paks\n", gdir);

	if ((len > 0) && (len < sizeof(gdir)) && (gdir[len - 1] == '/'))
	{
		gdir[len - 1] = 0;
	}

	FS_AddGameDirectory(gdir);
}
/*
================
FS_Init
================
*/
void CFileSystem::Init()
{
	mpLowLevelFileSystem->Init();

	tStringList dirs;
	bool hasDefaultDir = false;
	int		i;
	
	// Init memory
	fs_mempool = Mem_AllocPool( "FileSystem Pool" );	

	// add a path separator to the end of the basedir if it lacks one
	if( fs_basedir[0] && fs_basedir[Q_strlen(fs_basedir) - 1] != '/' && fs_basedir[Q_strlen(fs_basedir) - 1] != '\\' )
		Q_strncat( fs_basedir, "/", sizeof( fs_basedir ));

	fs_searchpaths = NULL;

	mpConsole->AddCommand("fs_rescan", FS_Rescan_f, "rescan filesystem search pathes");
	mpConsole->AddCommand("fs_path", FS_Path_f, "show filesystem search pathes");
	mpConsole->AddCommand("fs_clearpaths", FS_ClearPaths_f, "clear filesystem search pathes");

	// ignore commandlineoption "-game" for other stuff
	if( host.type == HOST_NORMAL || host.type == HOST_DEDICATED )
	{
		stringlistinit( &dirs );
		listdirectory( &dirs, "./" );
		stringlistsort( &dirs );
		SI.numgames = 0;
	
		if( !Sys_GetParmFromCmdLine( "-game", gs_basedir ))
			Q_strcpy( gs_basedir, SI.ModuleName ); // default dir

		if( FS_CheckNastyPath( gs_basedir, true ))
		{
			DevMsg( D_ERROR, "FS_Init: invalid game directory \"%s\"\n", gs_basedir );		
			Q_strcpy( gs_basedir, SI.ModuleName ); // default dir
		};

		// validate directories
		for( i = 0; i < dirs.numstrings; i++ )
		{
			if( !Q_stricmp( SI.ModuleName, dirs.strings[i] ))
				hasDefaultDir = true;

			if( !Q_stricmp( gs_basedir, dirs.strings[i] ))
				break;
		}

		if( i == dirs.numstrings )
		{ 
			DevMsg( D_INFO, "FS_Init: game directory \"%s\" not exist\n", gs_basedir );
			
			if(hasDefaultDir)
				Q_strncpy( gs_basedir, SI.ModuleName, sizeof( gs_basedir )); // default dir
		};

		// build list of game directories here
		FS_AddGameDirectory( "./", 0 );

		for( i = 0; i < dirs.numstrings; i++ )
		{
			if(!mpLowLevelFileSystem->SysFolderExists( dirs.strings[i] ) || (!Q_stricmp( dirs.strings[i], ".." ) && !fs_ext_path ))
				continue;

			if( !SI.games[SI.numgames] )
				SI.games[SI.numgames] = (gameinfo_t *)Mem_Alloc( fs_mempool, sizeof( gameinfo_t ));

			if( FS_ParseGameInfo( dirs.strings[i], SI.games[SI.numgames] ))
				SI.numgames++; // added
		};

		stringlistfreecontents( &dirs );
	};

	MsgDev( D_NOTE, "FS_Init: done\n" );
};
Beispiel #16
0
/*
 * Sets the gamedir and path to a different directory.
 */
void
FS_SetGamedir(char *dir)
{
	int i;
	fsSearchPath_t *next;

	if (strstr(dir, "..") || strstr(dir, "/"))
	{
		Com_Printf("Gamedir should be a single filename, not a path.\n");
		return;
	}

	/* Free up any current game dir info. */
	while (fs_searchPaths != fs_baseSearchPaths)
	{
		if (fs_searchPaths->pack)
		{
			if (fs_searchPaths->pack->pak)
			{
				fclose(fs_searchPaths->pack->pak);
			}

#ifdef ZIP
			if (fs_searchPaths->pack->pk3)
			{
				unzClose(fs_searchPaths->pack->pk3);
			}
#endif

			Z_Free(fs_searchPaths->pack->files);
			Z_Free(fs_searchPaths->pack);
		}

		next = fs_searchPaths->next;
		Z_Free(fs_searchPaths);
		fs_searchPaths = next;
	}

	/* Close open files for game dir. */
	for (i = 0; i < MAX_HANDLES; i++)
	{
		if (strstr(fs_handles[i].name, dir) &&
			((fs_handles[i].file != NULL)
#ifdef ZIP
			  || (fs_handles[i].zip != NULL)
#endif
			))
		{
			FS_FCloseFile(i);
		}
	}

	/* Flush all data, so it will be forced to reload. */
	if ((dedicated != NULL) && (dedicated->value != 1))
	{
		Cbuf_AddText("vid_restart\nsnd_restart\n");
	}

	Com_sprintf(fs_gamedir, sizeof(fs_gamedir), "%s/%s",
			fs_basedir->string, dir);

	if ((strcmp(dir, BASEDIRNAME) == 0) || (*dir == 0))
	{
		Cvar_FullSet("gamedir", "", CVAR_SERVERINFO | CVAR_NOSET);
		Cvar_FullSet("game", "", CVAR_LATCH | CVAR_SERVERINFO);
	}
	else
	{
		Cvar_FullSet("gamedir", dir, CVAR_SERVERINFO | CVAR_NOSET);

		if (fs_cddir->string[0] == '\0')
		{
			FS_AddGameDirectory(va("%s/%s", fs_cddir->string, dir));
		}

#ifdef SYSTEMWIDE
		FS_AddSystemwideGameDirectory(dir);
#endif

		FS_AddGameDirectory(va("%s/%s", fs_basedir->string, dir));
		FS_AddHomeAsGameDirectory(dir);
	}
}
Beispiel #17
0
void
FS_Startup(void)
{
	int i;
	fsSearchPath_t *next;
	fsPack_t *pack;

	if (strstr(fs_gamedirvar->string, "..") ||
		strstr(fs_gamedirvar->string, ".") ||
		strstr(fs_gamedirvar->string, "/") ||
		(fs_gamedirvar->string[0] == '\0'))
	{
		Com_Printf("Invalid game directory.\n");
		Cvar_ForceSet("fs_game", BASEDIRNAME);
	}

	/* Check for game override. */
	if (strcasecmp(fs_gamedirvar->string, fs_currentGame) != 0)
	{
		/* Free up any current game dir info. */
		while (fs_searchPaths != fs_baseSearchPaths)
		{
			if (fs_searchPaths->pack != NULL)
			{
				pack = fs_searchPaths->pack;

				if (pack->pak != NULL)
				{
					fclose(pack->pak);
				}

#ifdef ZIP
				if (pack->pk3 != NULL)
				{
					unzClose(pack->pk3);
				}
#endif

				Z_Free(pack->files);
				Z_Free(pack);
			}

			next = fs_searchPaths->next;
			Z_Free(fs_searchPaths);
			fs_searchPaths = next;
		}

		/* Close open files for game dir. */
		for (i = 0; i < MAX_HANDLES; i++)
		{
			if (strstr(fs_handles[i].name, fs_currentGame) &&
				((fs_handles[i].file != NULL)
#ifdef ZIP
				  || (fs_handles[i].zip != NULL)
#endif
				))
			{
				FS_FCloseFile(i);
			}
		}

		/* Don't add baseq2 again. */
		if (Q_stricmp(fs_gamedirvar->string, BASEDIRNAME) == 0)
		{
			Q_strlcpy(fs_gamedir, fs_basedir->string, sizeof(fs_gamedir));
		}
		else
		{
			/* Add the directories. */
			FS_AddGameDirectory(va("%s/%s", fs_homepath->string,
							fs_gamedirvar->string));
		}
	}

	Q_strlcpy(fs_currentGame, fs_gamedirvar->string, sizeof(fs_currentGame));

	FS_Path_f();
}