Merge remote-tracking branch 'queatz/furnace-fix'

master
Perttu Ahola 2011-08-31 17:04:12 +03:00
commit ad795c9f0c
2 changed files with 3 additions and 1 deletions

View File

@ -293,7 +293,7 @@ bool FurnaceNodeMetadata::step(float dtime)
If there is no source item or source item is not cookable, If there is no source item or source item is not cookable,
or furnace became overloaded, stop loop. or furnace became overloaded, stop loop.
*/ */
if((m_fuel_time < m_fuel_totaltime || dst_list->roomForCookedItem(src_item) == false) if((m_fuel_time < m_fuel_totaltime || (src_item && dst_list->roomForCookedItem(src_item) == false))
&& (src_item == NULL || m_src_totaltime < 0.001)) && (src_item == NULL || m_src_totaltime < 0.001))
{ {
m_step_accumulator = 0; m_step_accumulator = 0;

View File

@ -581,6 +581,8 @@ bool InventoryList::roomForItem(const InventoryItem *item)
bool InventoryList::roomForCookedItem(const InventoryItem *item) bool InventoryList::roomForCookedItem(const InventoryItem *item)
{ {
if(!item)
return false;
const InventoryItem *cook = item->createCookResult(); const InventoryItem *cook = item->createCookResult();
if(!cook) if(!cook)
return false; return false;