1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-11-17 14:55:13 -05:00

Fix minetest.get_craft_recipe function

Previously, calling it resulted in a crash.
This commit is contained in:
est31 2015-03-23 02:38:53 +01:00 committed by Craig Robbins
parent 0ae75f2a4e
commit 5b5c498011

View File

@ -393,6 +393,8 @@ int ModApiCraft::l_get_craft_recipe(lua_State *L)
std::vector<CraftDefinition*> recipes = server->cdef()
->getCraftRecipes(output, server, 1);
lua_createtable(L, 1, 0);
if (recipes.empty()) {
lua_pushnil(L);
lua_setfield(L, -2, "items");