From 5b5c4980112843e38d11cbc5c59d7c5de48da980 Mon Sep 17 00:00:00 2001 From: est31 Date: Mon, 23 Mar 2015 02:38:53 +0100 Subject: [PATCH] Fix minetest.get_craft_recipe function Previously, calling it resulted in a crash. --- src/script/lua_api/l_craft.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/script/lua_api/l_craft.cpp b/src/script/lua_api/l_craft.cpp index 40342871d..b321fb32f 100644 --- a/src/script/lua_api/l_craft.cpp +++ b/src/script/lua_api/l_craft.cpp @@ -393,6 +393,8 @@ int ModApiCraft::l_get_craft_recipe(lua_State *L) std::vector recipes = server->cdef() ->getCraftRecipes(output, server, 1); + lua_createtable(L, 1, 0); + if (recipes.empty()) { lua_pushnil(L); lua_setfield(L, -2, "items");