summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2009-01-23 15:10:13 +0000
committerglx <glx@openttd.org>2009-01-23 15:10:13 +0000
commitceb60b426e2af1866d98431b9d86a9659b0d766f (patch)
tree99a16452296bbf23a859827c5986f77ea18a09a7 /src
parentaaad553233d95d68134d2eba573dc144d14d7f00 (diff)
downloadopenttd-ceb60b426e2af1866d98431b9d86a9659b0d766f.tar.xz
(svn r15226) -Fix (r15214): broken AI content download
Diffstat (limited to 'src')
-rw-r--r--src/ai/ai_scanner.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/ai/ai_scanner.cpp b/src/ai/ai_scanner.cpp
index 0d4feb34d..e1a58b702 100644
--- a/src/ai/ai_scanner.cpp
+++ b/src/ai/ai_scanner.cpp
@@ -89,11 +89,6 @@ 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 {
@@ -106,11 +101,6 @@ 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);
}
@@ -288,7 +278,12 @@ void AIScanner::RegisterLibrary(AILibrary *library)
if (this->library_list.find(library_name) != this->library_list.end()) {
/* This AI was already registered */
+#ifdef WIN32
+ /* Windows doesn't care about the case */
+ if (strcasecmp(this->library_list[library_name]->GetMainScript(), library->GetMainScript()) == 0) {
+#else
if (strcmp(this->library_list[library_name]->GetMainScript(), library->GetMainScript()) == 0) {
+#endif
delete library;
return;
}
@@ -320,7 +315,12 @@ void AIScanner::RegisterAI(AIInfo *info)
if (this->info_list.find(ai_name) != this->info_list.end()) {
/* This AI was already registered */
+#ifdef WIN32
+ /* Windows doesn't care about the case */
+ if (strcasecmp(this->info_list[ai_name]->GetMainScript(), info->GetMainScript()) == 0) {
+#else
if (strcmp(this->info_list[ai_name]->GetMainScript(), info->GetMainScript()) == 0) {
+#endif
delete info;
return;
}