We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a50db0e commit 7ae0b90Copy full SHA for 7ae0b90
src/script/lua_api/l_craft.cpp
@@ -410,11 +410,11 @@ int ModApiCraft::l_get_all_craft_recipes(lua_State *L)
410
lua_newtable(L);
411
lua_newtable(L); // items
412
std::vector<ItemStack>::const_iterator iter = input.items.begin();
413
- for (u16 j = 0; iter != input.items.end(); iter++) {
+ for (u16 j = 1; iter != input.items.end(); iter++, j++) {
414
if (iter->empty())
415
continue;
416
lua_pushstring(L, iter->name.c_str());
417
- lua_rawseti(L, -2, ++j);
+ lua_rawseti(L, -2, j);
418
}
419
lua_setfield(L, -2, "items");
420
setintfield(L, -1, "width", input.width);
0 commit comments