diff options
Diffstat (limited to 'lib/LuaTask.cc')
-rw-r--r-- | lib/LuaTask.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/LuaTask.cc b/lib/LuaTask.cc index 7851afd..fdb723d 100644 --- a/lib/LuaTask.cc +++ b/lib/LuaTask.cc @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: LuaTask.cc,v 1.15 2007-06-18 08:13:33 pixel Exp $ */ +/* $Id: LuaTask.cc,v 1.16 2007-07-27 10:05:52 pixel Exp $ */ #include <LuaTask.h> #include <LuaHandle.h> @@ -81,13 +81,14 @@ String LuaTask::GetName() { } int LuaTask::Do() throw (GeneralException) { + bool yielded; switch (current) { case 0: current = 1; if (cmd != "") { - L->resume(cmd); + yielded = L->resume(cmd); } else { - L->resume(nargs); + yielded = L->resume(nargs); } case 2: nargs = 0; @@ -114,8 +115,10 @@ int LuaTask::Do() throw (GeneralException) { c = 0; if (current != 1) - L->resume(nargs); + yielded = L->resume(nargs); case 1: + if (!yielded) + return TASK_DONE; current = 2; if (L->gettop() >= 1) { task = L->tostring(1); |