From a4afa140f36673cd7dac1277aa4dd1d45618363b Mon Sep 17 00:00:00 2001 From: yexo Date: Wed, 19 Aug 2009 16:14:15 +0000 Subject: (svn r17223) -Change [NoAI] [FS#2980]: Crash an AI when it uses a DoCommand / Sleep instead of just printing an error message in the AI Debug Window --- src/ai/ai_instance.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/ai/ai_instance.cpp') diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp index 6d3397a70..a5ef5135b 100644 --- a/src/ai/ai_instance.cpp +++ b/src/ai/ai_instance.cpp @@ -352,6 +352,10 @@ void AIInstance::GameLoop() } catch (AI_VMSuspend e) { this->suspend = e.GetSuspendTime(); this->callback = e.GetSuspendCallback(); + } catch (AI_FatalError e) { + this->engine->ThrowError(e.GetErrorMessage()); + this->engine->ResumeError(); + this->Died(); } this->is_started = true; @@ -368,6 +372,10 @@ void AIInstance::GameLoop() } catch (AI_VMSuspend e) { this->suspend = e.GetSuspendTime(); this->callback = e.GetSuspendCallback(); + } catch (AI_FatalError e) { + this->engine->ThrowError(e.GetErrorMessage()); + this->engine->ResumeError(); + this->Died(); } } -- cgit v1.2.3-54-g00ecf