diff options
author | SmallJoker <SmallJoker@users.noreply.github.com> | 2018-10-10 20:48:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-10 20:48:58 +0200 |
commit | 0a5e77132ae8c495c50cfc58bbe4ce1bfcd377e3 (patch) | |
tree | d60c7186893663e2556d6d9efc46c14fd4520b0f /src/script/lua_api | |
parent | d6f2a1c4b8ab13cee92e2041b3410fe3548e88e6 (diff) | |
download | minetest-0a5e77132ae8c495c50cfc58bbe4ce1bfcd377e3.tar.gz minetest-0a5e77132ae8c495c50cfc58bbe4ce1bfcd377e3.tar.bz2 minetest-0a5e77132ae8c495c50cfc58bbe4ce1bfcd377e3.zip |
Add core.remove_detached_inventory (#7684)
Breaks backwards compatibility for good
Bump protocol version
Diffstat (limited to 'src/script/lua_api')
-rw-r--r-- | src/script/lua_api/l_inventory.cpp | 10 | ||||
-rw-r--r-- | src/script/lua_api/l_inventory.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/script/lua_api/l_inventory.cpp b/src/script/lua_api/l_inventory.cpp index 04fa3a196..6e7afa4a4 100644 --- a/src/script/lua_api/l_inventory.cpp +++ b/src/script/lua_api/l_inventory.cpp @@ -536,8 +536,18 @@ int ModApiInventory::l_create_detached_inventory_raw(lua_State *L) return 1; } +// remove_detached_inventory_raw(name) +int ModApiInventory::l_remove_detached_inventory_raw(lua_State *L) +{ + NO_MAP_LOCK_REQUIRED; + const std::string &name = luaL_checkstring(L, 1); + lua_pushboolean(L, getServer(L)->removeDetachedInventory(name)); + return 1; +} + void ModApiInventory::Initialize(lua_State *L, int top) { API_FCT(create_detached_inventory_raw); + API_FCT(remove_detached_inventory_raw); API_FCT(get_inventory); } diff --git a/src/script/lua_api/l_inventory.h b/src/script/lua_api/l_inventory.h index 2b7910ac3..94f670c9d 100644 --- a/src/script/lua_api/l_inventory.h +++ b/src/script/lua_api/l_inventory.h @@ -120,6 +120,8 @@ class ModApiInventory : public ModApiBase { private: static int l_create_detached_inventory_raw(lua_State *L); + static int l_remove_detached_inventory_raw(lua_State *L); + static int l_get_inventory(lua_State *L); public: |