summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-14 15:20:06 +0000
committerrubidium <rubidium@openttd.org>2009-01-14 15:20:06 +0000
commitea5457d83163cb03928d0d777d48c3c5cab96424 (patch)
treedb9afb60f81a1c43df282d4bedad750d6a829c7d
parentff4fcdb03cf45341b2a5d59da11e8ae26414cc86 (diff)
downloadopenttd-ea5457d83163cb03928d0d777d48c3c5cab96424.tar.xz
(svn r15082) -Codechange: make the AI library path also a searchdir instead of manually manufacturing it into a searchdir.
-rw-r--r--src/ai/ai_scanner.cpp2
-rw-r--r--src/fileio.cpp1
-rw-r--r--src/fileio_type.h1
3 files changed, 3 insertions, 1 deletions
diff --git a/src/ai/ai_scanner.cpp b/src/ai/ai_scanner.cpp
index de2715c9f..2a389fa9d 100644
--- a/src/ai/ai_scanner.cpp
+++ b/src/ai/ai_scanner.cpp
@@ -133,7 +133,7 @@ void AIScanner::ScanAIDir()
FOR_ALL_SEARCHPATHS(sp) {
FioAppendDirectory(buf, MAX_PATH, sp, AI_DIR);
if (FileExists(buf)) this->ScanDir(buf, false);
- ttd_strlcat(buf, "library" PATHSEP, MAX_PATH);
+ FioAppendDirectory(buf, MAX_PATH, sp, AI_LIBRARY_DIR);
if (FileExists(buf)) this->ScanDir(buf, true);
}
}
diff --git a/src/fileio.cpp b/src/fileio.cpp
index 5f60bf4c7..e39b704ac 100644
--- a/src/fileio.cpp
+++ b/src/fileio.cpp
@@ -218,6 +218,7 @@ const char *_subdirs[NUM_SUBDIRS] = {
"data" PATHSEP,
"lang" PATHSEP,
"ai" PATHSEP,
+ "ai" PATHSEP "library" PATHSEP,
};
const char *_searchpaths[NUM_SEARCHPATHS];
diff --git a/src/fileio_type.h b/src/fileio_type.h
index 534150616..0d992d1f5 100644
--- a/src/fileio_type.h
+++ b/src/fileio_type.h
@@ -20,6 +20,7 @@ enum Subdirectory {
DATA_DIR, ///< Subdirectory for all data (GRFs, sample.cat, intro game)
LANG_DIR, ///< Subdirectory for all translation files
AI_DIR, ///< Subdirectory for all AI files
+ AI_LIBRARY_DIR,///< Subdirectory for all AI libraries
NUM_SUBDIRS, ///< Number of subdirectories
NO_DIRECTORY, ///< A path without any base directory
};