summaryrefslogtreecommitdiff
path: root/src/script/script_instance.hpp
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-12-19 20:56:50 +0000
committertruebrain <truebrain@openttd.org>2011-12-19 20:56:50 +0000
commit83f2785f54de1c31267c5586464c97fb39f95b5a (patch)
treede073b47921321433fc0945bd63bc9c07d4a1f33 /src/script/script_instance.hpp
parentcbe43abe5db481568ccf988dbe994f43a985efbd (diff)
downloadopenttd-83f2785f54de1c31267c5586464c97fb39f95b5a.tar.xz
(svn r23611) -Add: run the begin of the script already while generating, and don't sleep on DoCommand while doing so
Diffstat (limited to 'src/script/script_instance.hpp')
-rw-r--r--src/script/script_instance.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/script/script_instance.hpp b/src/script/script_instance.hpp
index 8aa85744c..e7a23ccd9 100644
--- a/src/script/script_instance.hpp
+++ b/src/script/script_instance.hpp
@@ -159,6 +159,12 @@ public:
*/
void InsertEvent(class ScriptEvent *event);
+ /**
+ * Check if the instance is sleeping, which either happened because the
+ * script executed a DoCommand, or executed this.Sleep().
+ */
+ bool IsSleeping() { return this->suspend != 0; }
+
protected:
class Squirrel *engine; ///< A wrapper around the squirrel vm.