Fix FS_FOpenFileRead corner case
FS_FOpenFileRead is a fairly mental function that changes its return behaviour depending on whether or not file is NULL or not. It turns out in the case where file is NULL, we were returning the wrong value when the file didn't exist.
This commit is contained in:
@@ -1360,10 +1360,17 @@ long FS_FOpenFileRead(const char *filename, fileHandle_t *file, qboolean uniqueF
|
||||
fprintf(missingFiles, "%s\n", filename);
|
||||
#endif
|
||||
|
||||
if(file)
|
||||
*file = 0;
|
||||
|
||||
return -1;
|
||||
if(file)
|
||||
{
|
||||
*file = 0;
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
// When file is NULL, we're querying the existance of the file
|
||||
// If we've got here, it doesn't exist
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user