by streondj » Wed Dec 05, 2012 21:53
So I managed to get it working in the minimal,
in the game verison doesn't accept anything,
even if there is something to cook (wood -> ),
it's always out of fuel.
So I managed to get it working in the minimal,
in the game verison doesn't accept anything,
even if there is something to cook (wood),
it's always out of fuel.
----
been looking at the source files attempting to identify the issue,
seems like it may be that CRAFT_METHOD_FUEL doesn't have a return statement in craftdef.cpp
wheras CRAFT_METHOD_COOKING does have a return result lines, so would explain why cooking is working.
craftdef.cpp
else if(name == "fuel")
{
def = new CraftDefinitionFuel;
}
.
.
.
CraftInput CraftDefinitionFuel::getInput(const CraftOutput &output, IGameDef *gamedef) const
{
std::vector<std::string> rec;
rec.push_back(recipe);
return CraftInput(CRAFT_METHOD_COOKING,(int)burntime,craftGetItems(rec,gamedef));
}
craftdef.cpp te quote be
I'd think that it should say CRAFT_METHOD_FUEL
anyways if CRAFT_METHOD_FUEL isn't set somewhere, then the check for fuel will always return false
craftdef.cpp
bool CraftDefinitionFuel::check(const CraftInput &input, IGameDef *gamedef) const
{
if(input.method != CRAFT_METHOD_FUEL)
return false;
craftdef.cpp
as it is now, the above line 819 is the only mention of CRAFT_METHOD_FUEL in craftdef.cpp, so it makes sense that it's always false.
---
oh actually i'm not sure, it doesn't seem to make a different about the line now that I double checked, i'll do a full recompile see if it makes a difference.
---
yep there is absolutely no difference but w/e guess it couldn't hurt to patch the typo.
it works same way in minimal, and doesn't work in the game version just the same.
here is the patch anyways
craftdeff.cpp.diff
--- src/craftdef.cpp 2012-12-03 12:44:54.000000000 -0500
+++ ../../test/celeron55-minetest-a47b829/src/craftdef.cpp 2012-12-05 18:55:41.719732317 -0500
@@ -850,7 +850,7 @@
{
std::vector<std::string> rec;
rec.push_back(recipe);
- return CraftInput(CRAFT_METHOD_COOKING,(int)burntime,craftGetItems(rec,gamedef));
+ return CraftInput(CRAFT_METHOD_FUEL,(int)burntime,craftGetItems(rec,gamedef));
}
void CraftDefinitionFuel::decrementInput(CraftInput &input, IGameDef *gamedef) const
craftdeff.cpp.diff te patch be ya
----------------------------------
Okay, I found a rather brutish though simple solution for making furnace work in minetest_game by copying the minmal's default/init.lua overtop of the game's.
so the issue is within init.lua next step is to track it down.
-----
So i subdivided init.lua to make it more manageable into a number of files.
found the issue is in cook.lua
as Omnistudent refered, the problem was in lack of more
cook.lua
minetest.register_craft({
type = "cooking",
output = "default:coal_lump",
recipe = "default:tree",
})
cook.lua
anyways, guess i'll make a tarball of the fix..
----
been looking at the source files attempting to identify the issue,
seems like it may be that CRAFT_METHOD_FUEL doesn't have a return statement in craftdef.cpp
wheras CRAFT_METHOD_COOKING does have a return result lines, so would explain why cooking is working.
craftdef.cpp
else if(name == "fuel")
{
def = new CraftDefinitionFuel;
}
.
.
.
CraftInput CraftDefinitionFuel::getInput(const CraftOutput &output, IGameDef *gamedef) const
{
std::vector<std::string> rec;
rec.push_back(recipe);
return CraftInput(CRAFT_METHOD_COOKING,(int)burntime,craftGetItems(rec,gamedef));
}
craftdef.cpp te quote be
I'd think that it should say CRAFT_METHOD_FUEL
anyways if CRAFT_METHOD_FUEL isn't set somewhere, then the check for fuel will always return false
craftdef.cpp
bool CraftDefinitionFuel::check(const CraftInput &input, IGameDef *gamedef) const
{
if(input.method != CRAFT_METHOD_FUEL)
return false;
craftdef.cpp
as it is now, the above line 819 is the only mention of CRAFT_METHOD_FUEL in craftdef.cpp, so it makes sense that it's always false.
---
oh actually i'm not sure, it doesn't seem to make a different about the line now that I double checked, i'll do a full recompile see if it makes a difference.
---
yep there is absolutely no difference but w/e guess it couldn't hurt to patch the typo.
it works same way in minimal, and doesn't work in the game version just the same.
here is the patch anyways
craftdeff.cpp.diff
--- src/craftdef.cpp 2012-12-03 12:44:54.000000000 -0500
+++ ../../test/celeron55-minetest-a47b829/src/craftdef.cpp 2012-12-05 18:55:41.719732317 -0500
@@ -850,7 +850,7 @@
{
std::vector<std::string> rec;
rec.push_back(recipe);
- return CraftInput(CRAFT_METHOD_COOKING,(int)burntime,craftGetItems(rec,gamedef));
+ return CraftInput(CRAFT_METHOD_FUEL,(int)burntime,craftGetItems(rec,gamedef));
}
void CraftDefinitionFuel::decrementInput(CraftInput &input, IGameDef *gamedef) const
craftdeff.cpp.diff te patch be ya
----------------------------------
Okay, I found a rather brutish though simple solution for making furnace work in minetest_game by copying the minmal's default/init.lua overtop of the game's.
so the issue is within init.lua next step is to track it down.
-----
Last edited by
streondj on Thu Dec 06, 2012 04:29, edited 1 time in total.