From b5a960c57b5be87ad025d0a77660be83bfaebe29 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 9 May 2003 21:10:59 +0000 Subject: [PATCH] fix nq's gamedir handling for the -hipnotic etc shortcuts --- include/QF/quakefs.h | 1 - libs/util/quakefs.c | 10 +--------- nq/source/game.c | 13 ++++++------- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/include/QF/quakefs.h b/include/QF/quakefs.h index b46a820bf..eb1374c91 100644 --- a/include/QF/quakefs.h +++ b/include/QF/quakefs.h @@ -93,6 +93,5 @@ void QFS_LoadCacheFile (const char *path, struct cache_user_s *cu); void QFS_CreatePath (const char *path); void QFS_Gamedir (const char *dir); void QFS_Init (const char *game); -void QFS_CreateGameDirectory (const char *gamename); #endif // __quakefs_h diff --git a/libs/util/quakefs.c b/libs/util/quakefs.c index aafd62ed1..298ed11fc 100644 --- a/libs/util/quakefs.c +++ b/libs/util/quakefs.c @@ -1129,14 +1129,6 @@ QFS_Gamedir (const char *dir) Cache_Flush (); } -void -QFS_CreateGameDirectory (const char *gamename) -{ - if (strcmp (fs_userpath->string, ".")) - QFS_CreatePath (va ("%s/%s/dummy", fs_userpath->string, gamename)); - QFS_AddGameDirectory (gamename); -} - void QFS_Init (const char *game) { @@ -1267,7 +1259,7 @@ QFS_WOpen (const char *path, int zip) char mode[4] = "wb\000\000"; if (zip) - mode[2] = bound (1, zip, 9); + mode[2] = bound (1, zip, 9) + '0'; dsprintf (full_path, "%s/%s", fs_userpath->string, path); QFS_CreatePath (full_path->str); file = Qopen (full_path->str, mode); diff --git a/nq/source/game.c b/nq/source/game.c index 96aff3acb..35ff3e120 100644 --- a/nq/source/game.c +++ b/nq/source/game.c @@ -46,18 +46,17 @@ Game_Init (void) // FIXME: make this dependant on QF metadata in the mission packs standard_quake = true; + if ((i = COM_CheckParm ("-hipnotic"))) { - QFS_CreateGameDirectory ("hipnotic"); + QFS_Gamedir ("hipnotic"); standard_quake = false; hipnotic = true; - } - if ((i = COM_CheckParm ("-rogue"))) { - QFS_CreateGameDirectory ("rogue"); + } else if ((i = COM_CheckParm ("-rogue"))) { + QFS_Gamedir ("rogue"); standard_quake = false; rogue = true; - } - if ((i = COM_CheckParm ("-abyss"))) { - QFS_CreateGameDirectory ("abyss"); + } else if ((i = COM_CheckParm ("-abyss"))) { + QFS_Gamedir ("abyss"); abyss = true; } }