]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - prvm_cmds.c
print a different fopen message if it failed
[xonotic/darkplaces.git] / prvm_cmds.c
index c68c3ab818e71263db7fe65cbc70c59dc9a80a1d..9930c3318d551dc3844856476b4366799ec9dee4 100644 (file)
@@ -1459,9 +1459,17 @@ void VM_fopen(void)
                VM_FILES[filenum] = FS_Open(va("%s", filename), modestring, false, false);
 
        if (VM_FILES[filenum] == NULL)
+       {
+               if (developer.integer)
+                       Con_Printf("fopen: %s mode %s failed\n", filename, modestring);
                PRVM_G_FLOAT(OFS_RETURN) = -1;
+       }
        else
+       {
+               if (developer.integer)
+                       Con_Printf("fopen: %s mode %s opened as #%i\n", filename, modestring, filenum);
                PRVM_G_FLOAT(OFS_RETURN) = filenum;
+       }
 }
 
 /*
@@ -1489,6 +1497,8 @@ void VM_fclose(void)
                Con_Printf("VM_fclose: no such file handle %i (or file has been closed) in %s\n", filenum, PRVM_NAME);
                return;
        }
+       if (developer.integer)
+               Con_Printf("fclose #%i\n", filenum);
        FS_Close(VM_FILES[filenum]);
        VM_FILES[filenum] = NULL;
 }