Extensions
- Created scripts/extensions/README to describe samples. - Created sample extension scripts of each type.
This commit is contained in:
@@ -53,7 +53,6 @@
|
||||
#include <API.h>
|
||||
|
||||
extern Context context;
|
||||
Task* the_task = NULL;
|
||||
|
||||
#ifdef HAVE_LIBLUA
|
||||
|
||||
@@ -122,6 +121,7 @@ static int api_task_set (lua_State* L)
|
||||
catch (...)
|
||||
{
|
||||
// TODO Error!
|
||||
lua_pushstring (L, "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,16 +223,10 @@ bool API::callTaskHook (
|
||||
// Prepare args.
|
||||
lua_pushnumber (L, current.id);
|
||||
|
||||
// Expose the task.
|
||||
the_task = ¤t;
|
||||
|
||||
// Make call.
|
||||
if (lua_pcall (L, 1, 2, 0) != 0)
|
||||
throw std::string ("Error calling '") + function + "' - " + lua_tostring (L, -1) + ".";
|
||||
|
||||
// Hide the task.
|
||||
the_task = NULL;
|
||||
|
||||
// Call successful - get return values.
|
||||
if (!lua_isnumber (L, -2))
|
||||
throw std::string ("Error: '") + function + "' did not return a success indicator.";
|
||||
|
||||
Reference in New Issue
Block a user