(svn r17545) -Fix [FS#3202]: [NoAI] AIs had 'infinite' time when running code from the global scope

This commit is contained in:
rubidium
2009-09-15 16:18:10 +00:00
parent 3e3927cfcc
commit 83be7b09ea
2 changed files with 3 additions and 2 deletions

View File

@@ -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;
}