From: havoc Date: Mon, 17 May 2004 19:27:00 +0000 (+0000) Subject: Tomaz patch to fopen builtin which now tries to read files outside data/ (but won... X-Git-Tag: xonotic-v0.1.0preview~5869 X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=fc3a13a5dc1496107696a01398448c2a0cad3772;p=xonotic%2Fdarkplaces.git Tomaz patch to fopen builtin which now tries to read files outside data/ (but won't try to write or append outside data/), for better compatibility with other engines that don't use data/ in their FRIK_FILE implementation git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4181 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/pr_cmds.c b/pr_cmds.c index 7a24b55a..fae2c462 100644 --- a/pr_cmds.c +++ b/pr_cmds.c @@ -2805,6 +2805,10 @@ void PF_fopen(void) return; } pr_files[filenum] = FS_Open(va("data/%s", filename), modestring, false); + + if (pr_files[filenum] == NULL && modestring == "rb") + pr_files[filenum] = FS_Open(filename, modestring, false); + if (pr_files[filenum] == NULL) G_FLOAT(OFS_RETURN) = -1; else