Skip to content

Commit

Permalink
Bugfix to get_all_craft_recipes.
Browse files Browse the repository at this point in the history
Indexes for empty slots shall not be skipped.
  • Loading branch information
RealBadAngel committed Dec 21, 2013
1 parent a50db0e commit 7ae0b90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/script/lua_api/l_craft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7ae0b90

Please sign in to comment.