summaryrefslogtreecommitdiff
path: root/src/ai/ai_scanner.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2009-02-13 17:17:34 +0000
committeryexo <yexo@openttd.org>2009-02-13 17:17:34 +0000
commit8e14d77d0509e3b2d2162d16c2f9696680b0b1a0 (patch)
tree569a356b10c209708942b4184b1d6f9b100e228b /src/ai/ai_scanner.cpp
parent15b9366f0687182d635bb3e4bdce9451534a82ad (diff)
downloadopenttd-8e14d77d0509e3b2d2162d16c2f9696680b0b1a0.tar.xz
(svn r15467) -Fix [NoAI]: AIs with an error in their info.nut are no longer available in-game.
Diffstat (limited to 'src/ai/ai_scanner.cpp')
-rw-r--r--src/ai/ai_scanner.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ai/ai_scanner.cpp b/src/ai/ai_scanner.cpp
index db5acd90c..7e4e878d4 100644
--- a/src/ai/ai_scanner.cpp
+++ b/src/ai/ai_scanner.cpp
@@ -88,6 +88,8 @@ void AIScanner::ScanDir(const char *dirname, bool library_scan, bool library_rec
if (!FioCheckFileExists(info_script, AI_DIR) || !FioCheckFileExists(main_script, AI_DIR)) continue;
DEBUG(ai, 6, "Loading AI at location '%s'", main_script);
+ /* We don't care if one of the other scripst failed to load. */
+ this->engine->ResetCrashed();
this->engine->LoadScript(info_script);
} else {
char library_script[MAX_PATH];
@@ -100,6 +102,8 @@ void AIScanner::ScanDir(const char *dirname, bool library_scan, bool library_rec
if (!FioCheckFileExists(library_script, AI_LIBRARY_DIR) || !FioCheckFileExists(main_script, AI_LIBRARY_DIR)) continue;
DEBUG(ai, 6, "Loading AI Library at location '%s'", main_script);
+ /* We don't care if one of the other scripst failed to load. */
+ this->engine->ResetCrashed();
this->engine->LoadScript(library_script);
}
}
@@ -157,6 +161,7 @@ AIScanner::AIScanner() :
this->ScanAIDir();
/* Create the dummy AI */
+ this->engine->ResetCrashed();
extern void AI_CreateAIInfoDummy(HSQUIRRELVM vm);
AI_CreateAIInfoDummy(this->engine->GetVM());
}