diff options
author | Julian Laubstein <julianlaubstein@yahoo.de> | 2015-05-29 11:08:32 +0200 |
---|---|---|
committer | Julian Laubstein <julianlaubstein@yahoo.de> | 2015-05-29 11:08:32 +0200 |
commit | 1e6f02437e88495d57249f742526526ee5865777 (patch) | |
tree | af200ec3c23c5d04359ba471d275cfa6d0a3c7fb /src/Bindings/BindingsProcessor.lua | |
parent | Merge pull request #2157 from beeduck/Issue2106 (diff) | |
parent | Merge branch 'master' into PreventNewWarnings (diff) | |
download | cuberite-1e6f02437e88495d57249f742526526ee5865777.tar cuberite-1e6f02437e88495d57249f742526526ee5865777.tar.gz cuberite-1e6f02437e88495d57249f742526526ee5865777.tar.bz2 cuberite-1e6f02437e88495d57249f742526526ee5865777.tar.lz cuberite-1e6f02437e88495d57249f742526526ee5865777.tar.xz cuberite-1e6f02437e88495d57249f742526526ee5865777.tar.zst cuberite-1e6f02437e88495d57249f742526526ee5865777.zip |
Diffstat (limited to 'src/Bindings/BindingsProcessor.lua')
-rw-r--r-- | src/Bindings/BindingsProcessor.lua | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Bindings/BindingsProcessor.lua b/src/Bindings/BindingsProcessor.lua index f86be6c6d..fba992082 100644 --- a/src/Bindings/BindingsProcessor.lua +++ b/src/Bindings/BindingsProcessor.lua @@ -101,7 +101,7 @@ local function OutputLuaStateHelpers(a_Package) f:write("void Push(" .. item.name .. " * a_Value);\n") end for _, item in ipairs(types) do - f:write("void GetStackValue(int a_StackPos, Ptr" .. item.lname .. " & a_ReturnedVal);\n") + f:write("bool GetStackValue(int a_StackPos, Ptr" .. item.lname .. " & a_ReturnedVal);\n") end f:write("\n\n\n\n\n") f:close() @@ -125,15 +125,17 @@ local function OutputLuaStateHelpers(a_Package) end end for _, item in ipairs(types) do - f:write("void cLuaState::GetStackValue(int a_StackPos, Ptr" .. item.lname .. " & a_ReturnedVal)\n{\n\tASSERT(IsValid());\n") + f:write("bool cLuaState::GetStackValue(int a_StackPos, Ptr" .. item.lname .. " & a_ReturnedVal)\n{\n\tASSERT(IsValid());\n") f:write("\tif (lua_isnil(m_LuaState, a_StackPos))\n\t{\n") - f:write("\t a_ReturnedVal = nullptr;\n") - f:write("\t return;\n\t}\n") + f:write("\t\ta_ReturnedVal = nullptr;\n") + f:write("\t\treturn false;\n\t}\n") f:write("\ttolua_Error err;\n") f:write("\tif (tolua_isusertype(m_LuaState, a_StackPos, \"" .. item.name .. "\", false, &err))\n") f:write("\t{\n") - f:write("\t a_ReturnedVal = *(reinterpret_cast<" .. item.name .. " **>(lua_touserdata(m_LuaState, a_StackPos)));\n") + f:write("\t\ta_ReturnedVal = *(reinterpret_cast<" .. item.name .. " **>(lua_touserdata(m_LuaState, a_StackPos)));\n") + f:write("\t\treturn true;\n"); f:write("\t}\n") + f:write("\treturn false;\n") f:write("}\n\n\n\n\n\n") end f:close() |