summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbjarni <bjarni@openttd.org>2007-01-02 20:39:07 +0000
committerbjarni <bjarni@openttd.org>2007-01-02 20:39:07 +0000
commit25e03150a6837623b57cc49a6713ba561006e27f (patch)
tree9bc1ec4a7ec09021f0af6cd715f5bd8fc0ed9666
parent8b67672080c44729d6c2f62584c6e027d8acdc6f (diff)
downloadopenttd-25e03150a6837623b57cc49a6713ba561006e27f.tar.xz
(svn r7766) -Fix: [OSX] removed incorrect debug message about corrupted/missing grf files
The md5 code now looks in the secundary data dir as well Note: OSX builds can still give the incorrect message: dbg: [sl] Cannot open savegame 'data/opntitle.dat' for saving/loading.
-rw-r--r--src/gfxinit.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gfxinit.c b/src/gfxinit.c
index ae9fb3cb8..cfc7adbc4 100644
--- a/src/gfxinit.c
+++ b/src/gfxinit.c
@@ -121,6 +121,20 @@ static bool FileMD5(const MD5File file, bool warn)
}
#endif
+#if defined SECOND_DATA_DIR
+ /* If we failed to find the file in the first data directory, we will try the other one */
+
+ if (f == NULL) {
+ snprintf(buf, lengthof(buf), "%s%s", _paths.second_data_dir, file.filename);
+ f = fopen(buf, "rb");
+
+ if (f == NULL) {
+ strtolower(buf + strlen(_paths.second_data_dir) - 1);
+ f = fopen(buf, "rb");
+ }
+ }
+#endif
+
if (f != NULL) {
md5_state_t filemd5state;
md5_byte_t buffer[1024];