1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-12-23 16:08:51 -05:00

Fix minetest.get_(all)_craft_recipe(s) regression

Since 03e0dd33a8 the calls didn't return an output count
for the recipes.
This commit is contained in:
est31 2015-07-25 07:54:56 +02:00
parent 4e6971e593
commit fa1096ec49

View 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 CraftDefinition *recipe,
const CraftOutput &tmpout) const CraftOutput &tmpout)
{ {
@ -363,11 +363,11 @@ void push_craft_recipe(lua_State *L, IGameDef *gdef,
lua_pushstring(L, "unknown"); lua_pushstring(L, "unknown");
} }
lua_setfield(L, -2, "type"); lua_setfield(L, -2, "type");
lua_pushstring(L, tmpout.item.c_str()); lua_pushstring(L, output.item.c_str());
lua_setfield(L, -2, "output"); 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 std::vector<CraftDefinition*> &recipes,
const CraftOutput &output) const CraftOutput &output)
{ {