mirror of
https://github.com/UberGames/lilium-voyager.git
synced 2024-12-13 21:51:09 +00:00
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:
parent
693e51c654
commit
5fd456ff7c
1 changed files with 11 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue