mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Fix minetest.get_craft_recipe function
Previously, calling it resulted in a crash.
This commit is contained in:
parent
0ae75f2a4e
commit
5b5c498011
1 changed files 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()
|
std::vector<CraftDefinition*> recipes = server->cdef()
|
||||||
->getCraftRecipes(output, server, 1);
|
->getCraftRecipes(output, server, 1);
|
||||||
|
|
||||||
|
lua_createtable(L, 1, 0);
|
||||||
|
|
||||||
if (recipes.empty()) {
|
if (recipes.empty()) {
|
||||||
lua_pushnil(L);
|
lua_pushnil(L);
|
||||||
lua_setfield(L, -2, "items");
|
lua_setfield(L, -2, "items");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue