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/script/squirrel.cpp | 6 ++++++ src/script/squirrel.hpp | 5 +++++ 2 files changed, 11 insertions(+) (limited to 'src/script') diff --git a/src/script/squirrel.cpp b/src/script/squirrel.cpp index 31dcf6aea..1dd407589 100644 --- a/src/script/squirrel.cpp +++ b/src/script/squirrel.cpp @@ -187,6 +187,12 @@ bool Squirrel::Resume(int suspend) return this->vm->_suspended != 0; } +void Squirrel::ResumeError() +{ + assert(!this->crashed); + sq_resumeerror(this->vm); +} + void Squirrel::CollectGarbage() { sq_collectgarbage(this->vm); diff --git a/src/script/squirrel.hpp b/src/script/squirrel.hpp index 612c6ce2e..97dd7988d 100644 --- a/src/script/squirrel.hpp +++ b/src/script/squirrel.hpp @@ -106,6 +106,11 @@ public: */ bool Resume(int suspend = -1); + /** + * Resume the VM with an error so it prints a stack trace. + */ + void ResumeError(); + /** * Tell the VM to do a garbage collection run. */ -- cgit v1.2.3-70-g09d2