Skip to content
Permalink
Browse files

Bugfix to get_all_craft_recipes.

Indexes for empty slots shall not be skipped.
  • Loading branch information
RealBadAngel committed Dec 21, 2013
1 parent a50db0e commit 7ae0b90ff7d724e02b71da21b98e5895dc1b1767
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/script/lua_api/l_craft.cpp
@@ -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);

0 comments on commit 7ae0b90

Please sign in to comment.
You can’t perform that action at this time.