Ever hated the fact that Quake will only ever load PAK files that follow the PAK#.PAK naming convention? Ever wanted more appropriate names for your PAK files? This tutorial will show you how to make Quake load any PAK file, not just ones following the PAK#.PAK naming convention. Before we start, Id like to point out that parts of this code were taken from the Q3Radiant source release, I just found it and worked it into Quake. All changes are in common.cAt the top of the file, after the line: #include "quakedef.h" #include "io.h" char dirstring[1024]; int handle; struct _finddata_t fileinfo; for (i=0 ; ; i++) { sprintf (pakfile, "%s/pak%i.pak", dir, i); pak = COM_LoadPackFile (pakfile); if (!pak) break; search = Hunk_Alloc (sizeof(searchpath_t)); search->pack = pak; search->next = com_searchpaths; com_searchpaths = search; } // add ANY pak file - MrG (biteme@telefragged.com) sprintf (dirstring, "%s/*.pak", dir); handle = _findfirst (dirstring, &fileinfo); if (handle != -1) { do { if (fileinfo.name[0] == '.') continue; sprintf(pakfile,"%s/%s", dir, fileinfo.name); pak = COM_LoadPackFile (pakfile); if (!pak) break; search = Hunk_Alloc (sizeof(searchpath_t)); search->pack = pak; search->next = com_searchpaths; com_searchpaths = search; } while (_findnext( handle, &fileinfo ) != -1); _findclose (handle); } // end of PAK code update |