Fix minetest.get_(all)_craft_recipe(s) regression
authorest31 <MTest31@outlook.com>
Sat, 25 Jul 2015 05:54:56 +0000 (07:54 +0200)
committerest31 <MTest31@outlook.com>
Sat, 25 Jul 2015 15:33:41 +0000 (17:33 +0200)
Since 03e0dd33a847a83d975282c6caf6b926306e7b57 the calls didn't return an output count
for the recipes.

src/script/lua_api/l_craft.cpp

index f59487727aad3c2795312136cc2de1b6cd8da548..391a0133d9e1172731dd5a7823499d4816e56f45 100644 (file)
@@ -332,7 +332,7 @@ int ModApiCraft::l_get_craft_result(lua_State *L)
 }
 
 
-void push_craft_recipe(lua_State *L, IGameDef *gdef,
+static void push_craft_recipe(lua_State *L, IGameDef *gdef,
                const CraftDefinition *recipe,
                const CraftOutput &tmpout)
 {
@@ -363,11 +363,11 @@ void push_craft_recipe(lua_State *L, IGameDef *gdef,
                lua_pushstring(L, "unknown");
        }
        lua_setfield(L, -2, "type");
-       lua_pushstring(L, tmpout.item.c_str());
+       lua_pushstring(L, output.item.c_str());
        lua_setfield(L, -2, "output");
 }
 
-void push_craft_recipes(lua_State *L, IGameDef *gdef,
+static void push_craft_recipes(lua_State *L, IGameDef *gdef,
                const std::vector<CraftDefinition*> &recipes,
                const CraftOutput &output)
 {