summaryrefslogtreecommitdiff
path: root/src/ai
diff options
context:
space:
mode:
Diffstat (limited to 'src/ai')
-rw-r--r--src/ai/ai_instance.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp
index 384f2b4be..1405f6226 100644
--- a/src/ai/ai_instance.cpp
+++ b/src/ai/ai_instance.cpp
@@ -142,7 +142,8 @@ AIInstance::AIInstance(AIInfo *info) :
if (strcmp(main_script, "%_dummy") == 0) {
extern void AI_CreateAIDummy(HSQUIRRELVM vm);
AI_CreateAIDummy(this->engine->GetVM());
- } else if (!this->engine->LoadScript(main_script)) {
+ } else if (!this->engine->LoadScript(main_script) || this->engine->IsSuspended()) {
+ if (this->engine->IsSuspended()) AILog::Error("This AI took too long to load script. AI is not started.");
this->Died();
return;
}