From a2d5f86769c3b58ca0d8ab708f91b548b3cbe36d Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Wed, 18 Sep 2013 22:30:36 +0200 Subject: Improved error message in cPlugin:AddWebTab() API. --- source/ManualBindings.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/ManualBindings.cpp b/source/ManualBindings.cpp index 6ae84d53a..a2b4c8810 100644 --- a/source/ManualBindings.cpp +++ b/source/ManualBindings.cpp @@ -1501,14 +1501,16 @@ static int tolua_cPluginLua_AddWebTab(lua_State * tolua_S) tolua_Error tolua_err; tolua_err.array = 0; - tolua_err.index = 0; - tolua_err.type = 0; + tolua_err.index = 3; + tolua_err.type = "function"; std::string Title = ""; int Reference = LUA_REFNIL; - if( tolua_isstring( tolua_S, 2, 0, &tolua_err ) && - lua_isfunction( tolua_S, 3 ) ) + if ( + tolua_isstring(tolua_S, 2, 0, &tolua_err ) && + lua_isfunction(tolua_S, 3 ) + ) { Reference = luaL_ref(tolua_S, LUA_REGISTRYINDEX); Title = ((std::string) tolua_tocppstring(tolua_S,2,0)); -- cgit v1.2.3