1
0
Fork 0

(svn r17544) -Fix [FS#3202]: [NoAI] Crash when doing commands in the 'global' scope

release/1.0
rubidium 2009-09-15 16:16:28 +00:00
parent 4dfef325ce
commit 227824f753
1 changed files with 22 additions and 13 deletions

View File

@ -135,6 +135,8 @@ AIInstance::AIInstance(AIInfo *info) :
return;
}
try {
AIObject::SetAllowDoCommand(false);
/* Load and execute the script for this AI */
const char *main_script = info->GetMainScript();
if (strcmp(main_script, "%_dummy") == 0) {
@ -151,6 +153,13 @@ AIInstance::AIInstance(AIInfo *info) :
this->Died();
return;
}
AIObject::SetAllowDoCommand(true);
} catch (AI_FatalError e) {
this->is_dead = true;
this->engine->ThrowError(e.GetErrorMessage());
this->engine->ResumeError();
this->Died();
}
}
AIInstance::~AIInstance()