summaryrefslogtreecommitdiff
path: root/src/content_nodemeta.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-16 02:22:41 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-29 19:13:46 +0200
commit6a417c538f0af9e611d6f94cfb12d36f51982db8 (patch)
tree1bb137c17d3ca90e7cacbf27f810f26c29f50712 /src/content_nodemeta.cpp
parent7fae32095a843662dad77bd580a6a11637a53fe8 (diff)
downloadminetest-6a417c538f0af9e611d6f94cfb12d36f51982db8.tar.gz
minetest-6a417c538f0af9e611d6f94cfb12d36f51982db8.tar.bz2
minetest-6a417c538f0af9e611d6f94cfb12d36f51982db8.zip
Remove burn time definitions from FurnaceNodeMetadata
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;