Skip to content
Permalink
Browse files
Fix minetest.get_craft_recipe function
Previously, calling it resulted in a crash.
  • Loading branch information
est31 authored and Zeno- committed Mar 23, 2015
1 parent 0ae75f2 commit 5b5c4980112843e38d11cbc5c59d7c5de48da980
Showing 1 changed file with 2 additions and 0 deletions.
@@ -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");

0 comments on commit 5b5c498

Please sign in to comment.