Skip to content

Commit 7ae0b90

Browse files
committedDec 21, 2013
Bugfix to get_all_craft_recipes.
Indexes for empty slots shall not be skipped.
1 parent a50db0e commit 7ae0b90

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/script/lua_api/l_craft.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -410,11 +410,11 @@ int ModApiCraft::l_get_all_craft_recipes(lua_State *L)
410410
lua_newtable(L);
411411
lua_newtable(L); // items
412412
std::vector<ItemStack>::const_iterator iter = input.items.begin();
413-
for (u16 j = 0; iter != input.items.end(); iter++) {
413+
for (u16 j = 1; iter != input.items.end(); iter++, j++) {
414414
if (iter->empty())
415415
continue;
416416
lua_pushstring(L, iter->name.c_str());
417-
lua_rawseti(L, -2, ++j);
417+
lua_rawseti(L, -2, j);
418418
}
419419
lua_setfield(L, -2, "items");
420420
setintfield(L, -1, "width", input.width);

0 commit comments

Comments
 (0)
Please sign in to comment.