summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2009-01-23 01:29:13 +0000
committerglx <glx@openttd.org>2009-01-23 01:29:13 +0000
commit92f5c6b1da1b369e4518fc1f59b30feb9c771c30 (patch)
tree2d959ec8229db06d46172e13e8a1cbd98d941589 /src/ai
parentfab90386a74dee1f95b8a97e8a0f6a8ea1a2610d (diff)
downloadopenttd-92f5c6b1da1b369e4518fc1f59b30feb9c771c30.tar.xz
(svn r15214) -Fix [NoAI]: ignore case for ai/library main script path on windows
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/ai_scanner.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ai/ai_scanner.cpp b/src/ai/ai_scanner.cpp
index be0dfa59d..0d4feb34d 100644
--- a/src/ai/ai_scanner.cpp
+++ b/src/ai/ai_scanner.cpp
@@ -89,6 +89,11 @@ void AIScanner::ScanDir(const char *dirname, bool library_scan, bool library_rec
ttd_strlcat(main_script, "main.nut", sizeof(main_script));
if (!FioCheckFileExists(info_script, AI_DIR) || !FioCheckFileExists(main_script, AI_DIR)) continue;
+#ifdef WIN32
+ /* Windows doesn't care about the case */
+ strtolower(main_script);
+#endif
+
DEBUG(ai, 6, "Loading AI at location '%s'", main_script);
this->engine->LoadScript(info_script);
} else {
@@ -101,6 +106,11 @@ void AIScanner::ScanDir(const char *dirname, bool library_scan, bool library_rec
ttd_strlcat(main_script, "main.nut", sizeof(main_script));
if (!FioCheckFileExists(library_script, AI_LIBRARY_DIR) || !FioCheckFileExists(main_script, AI_LIBRARY_DIR)) continue;
+#ifdef WIN32
+ /* Windows doesn't care about the case */
+ strtolower(main_script);
+#endif
+
DEBUG(ai, 6, "Loading AI Library at location '%s'", main_script);
this->engine->LoadScript(library_script);
}