diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-03-09 21:30:42 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2012-03-10 18:07:29 +0100 |
commit | 78c912fb4007c3e5f0b43de02646772acb21ecf2 (patch) | |
tree | e45409ff061de75b0e4273763a87f5a25de6a65b /src/scripting/luautil.h | |
parent | 2fa7d1f39b24714ee6dc72b6b9e61ec5a1997724 (diff) | |
download | manaserv-78c912fb4007c3e5f0b43de02646772acb21ecf2.tar.gz manaserv-78c912fb4007c3e5f0b43de02646772acb21ecf2.tar.bz2 manaserv-78c912fb4007c3e5f0b43de02646772acb21ecf2.tar.xz manaserv-78c912fb4007c3e5f0b43de02646772acb21ecf2.zip |
Moved the managing of NPC script coroutines into C++
Rather than wrapping NPC functions up in coroutines in the Lua side, they
are now managed on the C++ side as "script threads", which are essentially
the same thing.
The main purpose is that the server can now know whether any of these long
running script interactions are still active, which will probably be useful
when adding the ability to reload scripts.
Reviewed-by: Erik Schilling
Diffstat (limited to 'src/scripting/luautil.h')
-rw-r--r-- | src/scripting/luautil.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/scripting/luautil.h b/src/scripting/luautil.h index 2a255280..89ea4800 100644 --- a/src/scripting/luautil.h +++ b/src/scripting/luautil.h @@ -21,10 +21,13 @@ #ifndef SCRIPTING_LUAUTIL_H #define SCRIPTING_LUAUTIL_H +#include "scripting/script.h" + extern "C" { #include <lualib.h> #include <lauxlib.h> } + #include <string> #include <list> #include <map> @@ -39,7 +42,6 @@ class MapObject; class Monster; class MonsterClass; class NPC; -class Script; class StatusEffect; class Thing; @@ -168,6 +170,7 @@ MonsterClass * checkMonsterClass(lua_State *s, int p); NPC * checkNPC(lua_State *s, int p); MapComposite * checkCurrentMap(lua_State *s, Script *script = 0); +Script::Thread* checkCurrentThread(lua_State *s, Script *script = 0); /* Polymorphic wrapper for pushing variables. |