diff options
author | JacobF <queatz@gmail.com> | 2011-09-01 15:39:15 -0400 |
---|---|---|
committer | JacobF <queatz@gmail.com> | 2011-09-01 15:39:15 -0400 |
commit | 5e3b9e35781dea24484bd3c4b6a13017bef413ea (patch) | |
tree | e36f3c6a3c8ef7ef7d50e29ea2e06050d9fef930 | |
parent | ad795c9f0c309d6d50b5679026690b055afe4a7c (diff) | |
download | minetest-5e3b9e35781dea24484bd3c4b6a13017bef413ea.tar.gz minetest-5e3b9e35781dea24484bd3c4b6a13017bef413ea.tar.bz2 minetest-5e3b9e35781dea24484bd3c4b6a13017bef413ea.zip |
* Furnace would say it was overloaded when it had a non-cookable source
* I didn't understand that expression last fix and now the furnace would burn fuel
even when it had no source item.
-rw-r--r-- | src/content_nodemeta.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/content_nodemeta.cpp b/src/content_nodemeta.cpp index e8f1e197e..701812219 100644 --- a/src/content_nodemeta.cpp +++ b/src/content_nodemeta.cpp @@ -182,7 +182,7 @@ std::string FurnaceNodeMetadata::infoText() assert(src_list); const InventoryItem *src_item = src_list->getItem(0); - if(src_item) { + if(src_item && src_item->isCookable()) { InventoryList *dst_list = m_inventory->getList("dst"); if(!dst_list->roomForCookedItem(src_item)) return "Furnace is overloaded"; @@ -284,17 +284,17 @@ bool FurnaceNodeMetadata::step(float dtime) } changed = true; - // Fall through if the fuel item was used up this step + // If the fuel was not used up this step, just keep burning it if(m_fuel_time < m_fuel_totaltime) continue; } /* - If there is no source item or source item is not cookable, - or furnace became overloaded, stop loop. + If there is no source item, or the source item is not cookable, + or the furnace is still cooking, or the furnace became overloaded, stop loop. */ - if((m_fuel_time < m_fuel_totaltime || (src_item && dst_list->roomForCookedItem(src_item) == false)) - && (src_item == NULL || m_src_totaltime < 0.001)) + if(src_item == NULL || !room_available || m_fuel_time < m_fuel_totaltime || + dst_list->roomForCookedItem(src_item) == false) { m_step_accumulator = 0; break; |