summaryrefslogtreecommitdiff
path: root/src/fileio.cpp
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2009-01-15 18:15:12 +0000
committertruebrain <truebrain@openttd.org>2009-01-15 18:15:12 +0000
commitef62688522218c50bed25bd8383e82365d91cdb0 (patch)
treefe14c05c0a3bd9c3c4546610ab53a830dc6bab9b /src/fileio.cpp
parenta039ec0d21008668b79509d097b9a6f59ea64977 (diff)
downloadopenttd-ef62688522218c50bed25bd8383e82365d91cdb0.tar.xz
(svn r15095) -Add [NoAI]: allow AI Libraries to be in .tar files (subdir required, as with AIs
-Add [NoAI]: allow multiple versions of the same AI co-exist -Change [NoAI]: updated the whole method of AI (Library) finding and loading; it is now much more clear and transparent -Change [NoAI]: the name of the AI is now the name used by CreateInstance() -Change [NoAI]: make the AI finder a bit more clever, mostly related to version finding
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 e39b704ac..fee63fd08 100644
--- a/src/fileio.cpp
+++ b/src/fileio.cpp
@@ -361,7 +361,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) && mode[0] == 'r') {
+ if (f == NULL && (subdir == DATA_DIR || subdir == AI_DIR || subdir == AI_LIBRARY_DIR) && 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];
@@ -772,6 +772,8 @@ void ScanForTarFiles()
num += ScanPathForTarFiles(path, strlen(path));
FioAppendDirectory(path, MAX_PATH, sp, AI_DIR);
num += ScanPathForTarFiles(path, strlen(path));
+ FioAppendDirectory(path, MAX_PATH, sp, AI_LIBRARY_DIR);
+ num += ScanPathForTarFiles(path, strlen(path));
}
DEBUG(misc, 1, "Scan complete, found %d files", num);
}