mirror of
https://github.com/minetest/minetest.git
synced 2025-02-17 10:23:47 +01:00
Fix minetest.get_craft_recipe function
Previously, calling it resulted in a crash.
This commit is contained in:
@ -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");
|
||||
|
Reference in New Issue
Block a user