From 9b1030cac4409b262dca73d2f0741fe78d4998ee Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sat, 22 Aug 2020 15:45:06 +0200 Subject: Added minetest.get_inventory(location) --- src/script/cpp_api/s_client.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src/script/cpp_api/s_client.cpp') diff --git a/src/script/cpp_api/s_client.cpp b/src/script/cpp_api/s_client.cpp index 7f88d2f96..0d4e21876 100644 --- a/src/script/cpp_api/s_client.cpp +++ b/src/script/cpp_api/s_client.cpp @@ -228,15 +228,7 @@ bool ScriptApiClient::on_inventory_open(Inventory *inventory) lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_inventory_open"); - std::vector lists = inventory->getLists(); - std::vector::iterator iter = lists.begin(); - lua_createtable(L, 0, lists.size()); - for (; iter != lists.end(); iter++) { - const char* name = (*iter)->getName().c_str(); - lua_pushstring(L, name); - push_inventory_list(L, inventory, name); - lua_rawset(L, -3); - } + push_inventory(L, inventory); runCallbacks(1, RUN_CALLBACKS_MODE_OR); return readParam(L, -1); -- cgit v1.2.3