diff options
author | RealBadAngel <mk@realbadangel.pl> | 2013-12-21 23:03:51 +0100 |
---|---|---|
committer | RealBadAngel <mk@realbadangel.pl> | 2013-12-21 23:03:51 +0100 |
commit | 7ae0b90ff7d724e02b71da21b98e5895dc1b1767 (patch) | |
tree | 1dc52500ad4b2845bf7b9fbb52bd6e69636d7d11 /src | |
parent | a50db0e824eba8e0e265099df256cafc333113d7 (diff) | |
download | minetest-7ae0b90ff7d724e02b71da21b98e5895dc1b1767.tar.gz minetest-7ae0b90ff7d724e02b71da21b98e5895dc1b1767.tar.bz2 minetest-7ae0b90ff7d724e02b71da21b98e5895dc1b1767.zip |
Bugfix to get_all_craft_recipes.
Indexes for empty slots shall not be skipped.
Diffstat (limited to 'src')
-rw-r--r-- | src/script/lua_api/l_craft.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/script/lua_api/l_craft.cpp b/src/script/lua_api/l_craft.cpp index ef13aa82c..aaca84c56 100644 --- a/src/script/lua_api/l_craft.cpp +++ b/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); |