--- quake2/qcommon/files.c 2018/04/24 17:58:32 1.1 +++ quake2/qcommon/files.c 2018/04/24 17:58:37 1.1.1.2 @@ -21,8 +21,6 @@ QUAKE FILESYSTEM */ -#define BASEDIRNAME "baseq2" - // // in memory // @@ -134,6 +132,37 @@ void FS_FCloseFile (FILE *f) fclose (f); } + +// RAFAEL +/* + Developer_searchpath +*/ +int Developer_searchpath (int who) +{ + + int ch; + char *start; + searchpath_t *search; + + if (who == 1) // xatrix + ch = 'x'; + + for (search = fs_searchpaths ; search ; search = search->next) + { + start = strchr (search->filename, ch); + + if (start == NULL) + continue; + + if (strcmp (start ,"xatrix") == 0) + return (1); + + } + return (0); + +} + + /* =========== FS_FOpenFile @@ -144,6 +173,7 @@ Used for streaming data out of either a a seperate file. =========== */ +int file_from_pak = 0; #ifndef NO_ADDONS int FS_FOpenFile (char *filename, FILE **file) { @@ -153,6 +183,8 @@ int FS_FOpenFile (char *filename, FILE * int i; filelink_t *link; + file_from_pak = 0; + // check for links first for (link = fs_links ; link ; link=link->next) { @@ -182,6 +214,7 @@ int FS_FOpenFile (char *filename, FILE * for (i=0 ; inumfiles ; i++) if (!Q_strcasecmp (pak->files[i].name, filename)) { // found it! + file_from_pak = 1; Com_DPrintf ("PackFile: %s : %s\n",pak->filename, filename); // open a new file on the pakfile *file = fopen (pak->filename, "rb"); @@ -225,6 +258,8 @@ int FS_FOpenFile (char *filename, FILE * pack_t *pak; int i; + file_from_pak = 0; + // get config from directory, everything else from pak if (!strcmp(filename, "config.cfg") || !strncmp(filename, "players/", 8)) { @@ -252,6 +287,7 @@ int FS_FOpenFile (char *filename, FILE * for (i=0 ; inumfiles ; i++) if (!Q_strcasecmp (pak->files[i].name, filename)) { // found it! + file_from_pak = 1; Com_DPrintf ("PackFile: %s : %s\n",pak->filename, filename); // open a new file on the pakfile *file = fopen (pak->filename, "rb");