From e5148493dbe11d9df0c22e534c98371bcdcb32ba Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sun, 24 Nov 2013 14:10:26 +0900 Subject: [PATCH] Prepend qfs_ to file_from_pak. A little better name-spacing. --- include/QF/quakefs.h | 6 +++++- libs/util/quakefs.c | 4 ++-- qw/source/sv_user.c | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/QF/quakefs.h b/include/QF/quakefs.h index ace4fd95a..0f180f691 100644 --- a/include/QF/quakefs.h +++ b/include/QF/quakefs.h @@ -97,7 +97,7 @@ extern const char *qfs_userpath; Set by QFS_FOpenFIle() and _QFS_FOpenFile(). */ -extern int file_from_pak; +extern int qfs_file_from_pak; /** The size of the file found via QFS_FOpenFIle() or _QFS_FOpenFile(). @@ -147,6 +147,10 @@ void QFS_Gamedir (const char *gamedir); \note It is a fatal error for \a end to be non-null but not in the list of vpaths. + \warning The returned pointer is to a static instance of findfile_t and + thus will be overwritten on the next call to any of the search + functions (QFS_FindFile, QFS_FOpenFIle, _QFS_FOpenFile) + \param fname The name of the file to be searched for. \param start The first vpath (gamedir) to search. \param end The last vpath (gamedir) to search. diff --git a/libs/util/quakefs.c b/libs/util/quakefs.c index 9b51e2d32..ce10e5445 100644 --- a/libs/util/quakefs.c +++ b/libs/util/quakefs.c @@ -1010,7 +1010,7 @@ QFS_CompressPath (const char *pth) return path; } -VISIBLE int file_from_pak; // global indicating file came from pack file ZOID +VISIBLE int qfs_file_from_pak; /* QFS_FOpenFile @@ -1023,7 +1023,7 @@ static void open_file (int_findfile_t *found, QFile **gzfile, dstring_t *foundname, int zip) { - file_from_pak = found->ff.in_pak; + qfs_file_from_pak = found->ff.in_pak; if (foundname) { dstring_copystr (foundname, found->ff.realname); } diff --git a/qw/source/sv_user.c b/qw/source/sv_user.c index 608b44480..3e3b1c4ce 100644 --- a/qw/source/sv_user.c +++ b/qw/source/sv_user.c @@ -764,7 +764,7 @@ SV_BeginDownload_f (void *unused) if (!host_client->download // ZOID: special check for maps, if it came from a pak file, don't // allow download - || (strncmp (name, "maps/", 5) == 0 && file_from_pak)) { + || (strncmp (name, "maps/", 5) == 0 && qfs_file_from_pak)) { if (host_client->download) { Qclose (host_client->download); host_client->download = NULL;