diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-04-10 21:52:03 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-04-10 21:52:03 +0200 |
commit | cc26f1646308a71ea78f0656efa670915e5e7345 (patch) | |
tree | 99b380f0d6466d4f67d792a6bd66b6dc87b80f02 /source/ManualBindings.cpp | |
parent | Fixed Windows Release build (diff) | |
download | cuberite-cc26f1646308a71ea78f0656efa670915e5e7345.tar cuberite-cc26f1646308a71ea78f0656efa670915e5e7345.tar.gz cuberite-cc26f1646308a71ea78f0656efa670915e5e7345.tar.bz2 cuberite-cc26f1646308a71ea78f0656efa670915e5e7345.tar.lz cuberite-cc26f1646308a71ea78f0656efa670915e5e7345.tar.xz cuberite-cc26f1646308a71ea78f0656efa670915e5e7345.tar.zst cuberite-cc26f1646308a71ea78f0656efa670915e5e7345.zip |
Diffstat (limited to '')
-rw-r--r-- | source/ManualBindings.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/source/ManualBindings.cpp b/source/ManualBindings.cpp index 358e582ee..bf8776457 100644 --- a/source/ManualBindings.cpp +++ b/source/ManualBindings.cpp @@ -968,6 +968,10 @@ static int copy_lua_values(lua_State * a_Source, lua_State * a_Destination, int return 1; } + + + + static int tolua_cPlugin_Call(lua_State* tolua_S) { cPlugin_NewLua * self = (cPlugin_NewLua *) tolua_tousertype(tolua_S, 1, 0); @@ -1095,6 +1099,40 @@ static int tolua_get_HTTPRequest_FormData(lua_State* tolua_S) +static int Lua_ItemGrid_GetSlotCoords(lua_State * L) +{ + tolua_Error tolua_err; + if ( + !tolua_isusertype(L, 1, "const cItemGrid", 0, &tolua_err) || + !tolua_isnumber (L, 2, 0, &tolua_err) || + !tolua_isnoobj (L, 3, &tolua_err) + ) + { + goto tolua_lerror; + } + + const cItemGrid * self = (const cItemGrid *)tolua_tousertype(L, 1, 0); + int SlotNum = (int)tolua_tonumber(L, 2, 0); + if (self == NULL) + { + tolua_error(L, "invalid 'self' in function 'cItemGrid:GetSlotCoords'", NULL); + return 0; + } + int X, Y; + self->GetSlotCoords(SlotNum, X, Y); + tolua_pushnumber(L, (lua_Number)X); + tolua_pushnumber(L, (lua_Number)Y); + return 2; + +tolua_lerror: + tolua_error(L, "#ferror in function 'FindKey'.", &tolua_err); + return 0; +} + + + + + void ManualBindings::Bind( lua_State* tolua_S ) { tolua_beginmodule(tolua_S,NULL); @@ -1158,6 +1196,10 @@ void ManualBindings::Bind( lua_State* tolua_S ) tolua_constant(tolua_S, "MAX_VIEW_DISTANCE", cClientHandle::MAX_VIEW_DISTANCE); tolua_endmodule(tolua_S); + tolua_beginmodule(tolua_S, "cItemGrid"); + tolua_function(tolua_S, "GetSlotCoords", Lua_ItemGrid_GetSlotCoords); + tolua_endmodule(tolua_S); + tolua_function(tolua_S, "md5", tolua_md5); tolua_endmodule(tolua_S); |