]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - common.c
added loadsize variable set by COM_LoadFile
[xonotic/darkplaces.git] / common.c
index 7b1fd49f4cce06d81a6d6a04d1a7c3a2eab3eec3..56d7f5ee031376fc8aa8ac195d2aeaa703f88d82 100644 (file)
--- a/common.c
+++ b/common.c
@@ -1660,9 +1660,9 @@ Filename are reletive to the quake directory.
 Always appends a 0 byte.
 ============
 */
-cache_user_t *loadcache;
-byte    *loadbuf;
-int             loadsize;
+cache_user_t   *loadcache;
+byte                   *loadbuf;
+int                            loadsize;
 byte *COM_LoadFile (char *path, int usehunk, qboolean quiet)
 {
        QFile             *h;
@@ -1671,11 +1671,14 @@ byte *COM_LoadFile (char *path, int usehunk, qboolean quiet)
        int             len;
 
        buf = NULL;     // quiet compiler warning
+       loadsize = 0;
 
 // look for it in the filesystem or pack files
        len = COM_FOpenFile (path, &h, quiet, true);
        if (!h)
                return NULL;
+
+       loadsize = len;
        
 // extract the filename base name for hunk tag
        COM_FileBase (path, base);