summaryrefslogtreecommitdiff
path: root/src/fileio.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-03-04 09:53:31 +0000
committerrubidium <rubidium@openttd.org>2009-03-04 09:53:31 +0000
commita6ca7b82372f59ff3d591e032b0b2b6a906fa1dc (patch)
tree9a2c02d0b0de1ad7374ee64afe0beadcb8f2b21f /src/fileio.cpp
parentceea4927df5b0e98221a7af6406315c41ab63250 (diff)
downloadopenttd-a6ca7b82372f59ff3d591e032b0b2b6a906fa1dc.tar.xz
(svn r15610) -Change: allow loading of heightmaps and savegames (any form) that are in .tar files
Diffstat (limited to 'src/fileio.cpp')
-rw-r--r--src/fileio.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/fileio.cpp b/src/fileio.cpp
index a976135d0..3ad29b6f2 100644
--- a/src/fileio.cpp
+++ b/src/fileio.cpp
@@ -358,7 +358,7 @@ FILE *FioFOpenFile(const char *filename, const char *mode, Subdirectory subdir,
}
/* We can only use .tar in case of data-dir, and read-mode */
- if (f == NULL && (subdir == DATA_DIR || subdir == AI_DIR || subdir == AI_LIBRARY_DIR) && mode[0] == 'r') {
+ if (f == NULL && mode[0] == 'r') {
static const uint MAX_RESOLVED_LENGTH = 2 * (100 + 100 + 155) + 1; // Enough space to hold two filenames plus link. See 'TarHeader'.
char resolved_name[MAX_RESOLVED_LENGTH];
@@ -777,6 +777,8 @@ void ScanForTarFiles()
num += ScanPathForTarFiles(path, strlen(path));
FioAppendDirectory(path, MAX_PATH, sp, AI_LIBRARY_DIR);
num += ScanPathForTarFiles(path, strlen(path));
+ FioAppendDirectory(path, MAX_PATH, sp, SCENARIO_DIR);
+ num += ScanPathForTarFiles(path, strlen(path));
}
DEBUG(misc, 1, "Scan complete, found %d files", num);
}