mirror of
https://github.com/minetest/minetest.git
synced 2024-12-28 00:47:29 +01:00
Bugfix to get_all_craft_recipes.
Indexes for empty slots shall not be skipped.
This commit is contained in:
parent
a50db0e824
commit
7ae0b90ff7
@ -410,11 +410,11 @@ int ModApiCraft::l_get_all_craft_recipes(lua_State *L)
|
||||
lua_newtable(L);
|
||||
lua_newtable(L); // items
|
||||
std::vector<ItemStack>::const_iterator iter = input.items.begin();
|
||||
for (u16 j = 0; iter != input.items.end(); iter++) {
|
||||
for (u16 j = 1; iter != input.items.end(); iter++, j++) {
|
||||
if (iter->empty())
|
||||
continue;
|
||||
lua_pushstring(L, iter->name.c_str());
|
||||
lua_rawseti(L, -2, ++j);
|
||||
lua_rawseti(L, -2, j);
|
||||
}
|
||||
lua_setfield(L, -2, "items");
|
||||
setintfield(L, -1, "width", input.width);
|
||||
|
Loading…
Reference in New Issue
Block a user