From 65d0d19b1616e5867afdf9d9f1c68972d2c3f2b0 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 4 Nov 2011 23:20:14 +0000 Subject: (svn r23118) -Feature: [NoAI] Allow AIs to query the amount of remaining operations for the current tick --- src/script/squirrel.cpp | 5 +++++ src/script/squirrel.hpp | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'src/script') diff --git a/src/script/squirrel.cpp b/src/script/squirrel.cpp index 890630eeb..e4657a7dd 100644 --- a/src/script/squirrel.cpp +++ b/src/script/squirrel.cpp @@ -553,3 +553,8 @@ bool Squirrel::CanSuspend() { return sq_can_suspend(this->vm); } + +SQInteger Squirrel::GetOpsTillSuspend() +{ + return this->vm->_ops_till_suspend; +} diff --git a/src/script/squirrel.hpp b/src/script/squirrel.hpp index 1ada519cc..69e01e647 100644 --- a/src/script/squirrel.hpp +++ b/src/script/squirrel.hpp @@ -253,6 +253,11 @@ public: * Are we allowed to suspend the squirrel script at this moment? */ bool CanSuspend(); + + /** + * How many operations can we execute till suspension? + */ + SQInteger GetOpsTillSuspend(); }; #endif /* SQUIRREL_HPP */ -- cgit v1.2.3-70-g09d2