mirror of
https://github.com/minetest/minetest.git
synced 2024-11-10 01:33:46 +01:00
* 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.
This commit is contained in:
parent
ad795c9f0c
commit
5e3b9e3578
@ -182,7 +182,7 @@ std::string FurnaceNodeMetadata::infoText()
|
|||||||
assert(src_list);
|
assert(src_list);
|
||||||
const InventoryItem *src_item = src_list->getItem(0);
|
const InventoryItem *src_item = src_list->getItem(0);
|
||||||
|
|
||||||
if(src_item) {
|
if(src_item && src_item->isCookable()) {
|
||||||
InventoryList *dst_list = m_inventory->getList("dst");
|
InventoryList *dst_list = m_inventory->getList("dst");
|
||||||
if(!dst_list->roomForCookedItem(src_item))
|
if(!dst_list->roomForCookedItem(src_item))
|
||||||
return "Furnace is overloaded";
|
return "Furnace is overloaded";
|
||||||
@ -284,17 +284,17 @@ bool FurnaceNodeMetadata::step(float dtime)
|
|||||||
}
|
}
|
||||||
changed = true;
|
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)
|
if(m_fuel_time < m_fuel_totaltime)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
If there is no source item or source item is not cookable,
|
If there is no source item, or the source item is not cookable,
|
||||||
or furnace became overloaded, stop loop.
|
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))
|
if(src_item == NULL || !room_available || m_fuel_time < m_fuel_totaltime ||
|
||||||
&& (src_item == NULL || m_src_totaltime < 0.001))
|
dst_list->roomForCookedItem(src_item) == false)
|
||||||
{
|
{
|
||||||
m_step_accumulator = 0;
|
m_step_accumulator = 0;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user