summaryrefslogtreecommitdiff
path: root/src/content_nodemeta.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/content_nodemeta.cpp')
-rw-r--r--src/content_nodemeta.cpp81
1 files changed, 4 insertions, 77 deletions
diff --git a/src/content_nodemeta.cpp b/src/content_nodemeta.cpp
index 50dcbd080..17b4a3da4 100644
--- a/src/content_nodemeta.cpp
+++ b/src/content_nodemeta.cpp
@@ -326,7 +326,7 @@ bool FurnaceNodeMetadata::step(float dtime)
// accomodate any result item
if(room_available)
{
- m_src_totaltime = 3;
+ m_src_totaltime = src_item->getCookTime();
}
else
{
@@ -381,85 +381,12 @@ bool FurnaceNodeMetadata::step(float dtime)
assert(fuel_list);
const InventoryItem *fuel_item = fuel_list->getItem(0);
- if(ItemSpec(ITEM_MATERIAL, CONTENT_TREE).checkItem(fuel_item))
- {
- m_fuel_totaltime = 30;
- m_fuel_time = 0;
- fuel_list->decrementMaterials(1);
- changed = true;
- }
- else if(ItemSpec(ITEM_MATERIAL, CONTENT_JUNGLETREE).checkItem(fuel_item))
- {
- m_fuel_totaltime = 30;
- m_fuel_time = 0;
- fuel_list->decrementMaterials(1);
- changed = true;
- }
- else if(ItemSpec(ITEM_MATERIAL, CONTENT_FENCE).checkItem(fuel_item))
- {
- m_fuel_totaltime = 30/2;
- m_fuel_time = 0;
- fuel_list->decrementMaterials(1);
- changed = true;
- }
- else if(ItemSpec(ITEM_MATERIAL, CONTENT_WOOD).checkItem(fuel_item))
- {
- m_fuel_totaltime = 30/4;
- m_fuel_time = 0;
- fuel_list->decrementMaterials(1);
- changed = true;
- }
- else if(ItemSpec(ITEM_MATERIAL, CONTENT_BOOKSHELF).checkItem(fuel_item))
- {
- m_fuel_totaltime = 30/4;
- m_fuel_time = 0;
- fuel_list->decrementMaterials(1);
- changed = true;
- }
- else if(ItemSpec(ITEM_MATERIAL, CONTENT_LEAVES).checkItem(fuel_item))
- {
- m_fuel_totaltime = 30/16;
- m_fuel_time = 0;
- fuel_list->decrementMaterials(1);
- changed = true;
- }
- else if(ItemSpec(ITEM_MATERIAL, CONTENT_PAPYRUS).checkItem(fuel_item))
- {
- m_fuel_totaltime = 30/32;
- m_fuel_time = 0;
- fuel_list->decrementMaterials(1);
- changed = true;
- }
- else if(ItemSpec(ITEM_MATERIAL, CONTENT_JUNGLEGRASS).checkItem(fuel_item))
- {
- m_fuel_totaltime = 30/32;
- m_fuel_time = 0;
- fuel_list->decrementMaterials(1);
- changed = true;
- }
- else if(ItemSpec(ITEM_MATERIAL, CONTENT_CACTUS).checkItem(fuel_item))
- {
- m_fuel_totaltime = 30/4;
+ if(fuel_item && fuel_item->getBurnTime() >= 0){
+ m_fuel_totaltime = fuel_item->getBurnTime();
m_fuel_time = 0;
fuel_list->decrementMaterials(1);
changed = true;
- }
- else if(ItemSpec(ITEM_CRAFT, "Stick").checkItem(fuel_item))
- {
- m_fuel_totaltime = 30/4/4;
- m_fuel_time = 0;
- fuel_list->decrementMaterials(1);
- changed = true;
- }
- else if(ItemSpec(ITEM_CRAFT, "lump_of_coal").checkItem(fuel_item))
- {
- m_fuel_totaltime = 40;
- m_fuel_time = 0;
- fuel_list->decrementMaterials(1);
- changed = true;
- }
- else
- {
+ } else {
//infostream<<"No fuel found"<<std::endl;
// No fuel, stop loop.
m_step_accumulator = 0;