From 56a7b2e6fdf6cee70df050147638437d1071b3c6 Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Thu, 30 Dec 2010 16:35:16 +0000 Subject: [PATCH] added file_from_pak as a new flobal, made COM_FindFile() to set it properly. from quakeworld sources. git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@352 af15c1b1-3010-417e-b628-4374ebc0bcbd --- Quake/common.c | 4 ++++ Quake/common.h | 1 + 2 files changed, 5 insertions(+) diff --git a/Quake/common.c b/Quake/common.c index d1645d73..e854363e 100644 --- a/Quake/common.c +++ b/Quake/common.c @@ -1365,6 +1365,7 @@ typedef struct char com_gamedir[MAX_OSPATH]; char com_basedir[MAX_OSPATH]; +int file_from_pak; // ZOID: global indicating that file came from a pak typedef struct searchpath_s { @@ -1499,6 +1500,8 @@ int COM_FindFile (const char *filename, int *handle, FILE **file) if (!file && !handle) Sys_Error ("COM_FindFile: neither handle or file set"); + file_from_pak = 0; + // // search through the path, one element at a time // @@ -1531,6 +1534,7 @@ int COM_FindFile (const char *filename, int *handle, FILE **file) if (*file) fseek (*file, pak->files[i].filepos, SEEK_SET); } + file_from_pak = 1; com_filesize = pak->files[i].filelen; return com_filesize; } diff --git a/Quake/common.h b/Quake/common.h index 403847d4..c236b433 100644 --- a/Quake/common.h +++ b/Quake/common.h @@ -183,6 +183,7 @@ struct cache_user_s; extern char com_basedir[MAX_OSPATH]; extern char com_gamedir[MAX_OSPATH]; +extern int file_from_pak; // global indicating that file came from a pak void COM_WriteFile (const char *filename, const void *data, int len); int COM_OpenFile (const char *filename, int *hndl);