Furnace was crashing stuff again
authorJacobF <queatz@gmail.com>
Fri, 2 Sep 2011 21:33:06 +0000 (17:33 -0400)
committerJacobF <queatz@gmail.com>
Fri, 2 Sep 2011 21:33:06 +0000 (17:33 -0400)
src/content_nodemeta.cpp

index 701812219fa756781272ef24c4c62cdb56014ad7..1552c8e1524ace63957af47df30d0fdc9e06f0a7 100644 (file)
@@ -245,7 +245,7 @@ bool FurnaceNodeMetadata::step(float dtime)
 
                InventoryList *src_list = m_inventory->getList("src");
                assert(src_list);
-               const InventoryItem *src_item = src_list->getItem(0);
+               InventoryItem *src_item = src_list->getItem(0);
                
                bool room_available = false;
                
@@ -289,6 +289,11 @@ bool FurnaceNodeMetadata::step(float dtime)
                                continue;
                }
                
+               /*
+                       Get the source again in case it has all burned
+               */
+               src_item = src_list->getItem(0);
+               
                /*
                        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.