diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2011-06-12 21:51:47 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2011-06-12 21:51:47 +0200 |
commit | 48b4b813a51c374fce43a553608c67c6ca08ea37 (patch) | |
tree | 853cfe0c7551b44d3544f776e926e70e9382b121 /scripting/test.cpp | |
parent | b44b2cb4c16995d218e8d4c767c01c7b87c89816 (diff) |
Added a say() function to lua.
Diffstat (limited to 'scripting/test.cpp')
-rw-r--r-- | scripting/test.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scripting/test.cpp b/scripting/test.cpp index 1a378b7..5ec27da 100644 --- a/scripting/test.cpp +++ b/scripting/test.cpp @@ -9,3 +9,10 @@ void print(lua_State *L, const char *s) { lua_pop(L, 1); lua->print(s); } + +void say(lua_State *L, const char *s) { + lua_getglobal(L, "lua_instance"); + Lua *lua = static_cast<Lua*>(lua_touserdata(L, -1)); + lua_pop(L, 1); + lua->say(s); +} |