diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-06-02 23:59:25 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-06-02 23:59:25 +0200 |
commit | 8ff22344af60a8f1d7de4501f04c7f659bd5bb08 (patch) | |
tree | db241c9647d8e4c51d49d1f47c1b3236842f3747 /source/Plugin_NewLua.cpp | |
parent | Added the possibility to specify enchantments by name in the constructor and AddFromString() function (diff) | |
download | cuberite-8ff22344af60a8f1d7de4501f04c7f659bd5bb08.tar cuberite-8ff22344af60a8f1d7de4501f04c7f659bd5bb08.tar.gz cuberite-8ff22344af60a8f1d7de4501f04c7f659bd5bb08.tar.bz2 cuberite-8ff22344af60a8f1d7de4501f04c7f659bd5bb08.tar.lz cuberite-8ff22344af60a8f1d7de4501f04c7f659bd5bb08.tar.xz cuberite-8ff22344af60a8f1d7de4501f04c7f659bd5bb08.tar.zst cuberite-8ff22344af60a8f1d7de4501f04c7f659bd5bb08.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Plugin_NewLua.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/Plugin_NewLua.cpp b/source/Plugin_NewLua.cpp index a76b51806..885184c12 100644 --- a/source/Plugin_NewLua.cpp +++ b/source/Plugin_NewLua.cpp @@ -1665,7 +1665,7 @@ void cPlugin_NewLua::Unreference(int a_LuaRef) -bool cPlugin_NewLua::CallbackWindowClosing(int a_FnRef, cWindow & a_Window, cPlayer & a_Player) +bool cPlugin_NewLua::CallbackWindowClosing(int a_FnRef, cWindow & a_Window, cPlayer & a_Player, bool a_CanRefuse) { ASSERT(a_FnRef != LUA_REFNIL); @@ -1673,9 +1673,10 @@ bool cPlugin_NewLua::CallbackWindowClosing(int a_FnRef, cWindow & a_Window, cPla lua_rawgeti(m_LuaState, LUA_REGISTRYINDEX, a_FnRef); // Push the function to be called tolua_pushusertype(m_LuaState, &a_Window, "cWindow"); tolua_pushusertype(m_LuaState, &a_Player, "cPlayer"); + tolua_pushboolean (m_LuaState, a_CanRefuse ? 1 : 0); // Call function: - int s = lua_pcall(m_LuaState, 2, 1, 0); + int s = lua_pcall(m_LuaState, 3, 1, 0); if (report_errors(m_LuaState, s)) { LOGERROR("LUA error in %s. Stack size: %i", __FUNCTION__, lua_gettop(m_LuaState)); |