Skip to content

Commit

Permalink
Fix minetest.get_craft_recipe function
Browse files Browse the repository at this point in the history
Previously, calling it resulted in a crash.
  • Loading branch information
est31 authored and Zeno- committed Mar 23, 2015
1 parent 0ae75f2 commit 5b5c498
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/script/lua_api/l_craft.cpp
Expand Up @@ -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");
Expand Down

0 comments on commit 5b5c498

Please sign in to comment.