]> git.lizzy.rs Git - minetest.git/blobdiff - src/inventory.cpp
Fixed a temporary solution of server shutting down to an assert(0) when a too large...
[minetest.git] / src / inventory.cpp
index b14828ae22ba3250c9aee688cee40c4434a38137..f91e2e0b6cd6e433e784d7b1b5ad0a18d757e135 100644 (file)
@@ -160,7 +160,6 @@ video::ITexture * CraftItem::getImage()
                name = "cloud.png";
        
        // Get such a texture
-       //return g_irrlicht->getTexture(name);
        return g_texturesource->getTextureRaw(name);
 }
 #endif
@@ -180,6 +179,16 @@ ServerActiveObject* CraftItem::createSAO(ServerEnvironment *env, u16 id, v3f pos
        }
 }
 
+u16 CraftItem::getDropCount()
+{
+       // Special cases
+       if(m_subname == "rat")
+               return 1;
+       // Default
+       else
+               return InventoryItem::getDropCount();
+}
+
 bool CraftItem::isCookable()
 {
        if(m_subname == "lump_of_iron")
@@ -278,6 +287,7 @@ InventoryList::InventoryList(std::string name, u32 size)
        m_name = name;
        m_size = size;
        clearItems();
+       //m_dirty = false;
 }
 
 InventoryList::~InventoryList()
@@ -303,6 +313,8 @@ void InventoryList::clearItems()
        {
                m_items.push_back(NULL);
        }
+
+       //setDirty(true);
 }
 
 void InventoryList::serialize(std::ostream &os)
@@ -396,6 +408,7 @@ InventoryList & InventoryList::operator = (const InventoryList &other)
                        m_items[i] = item->clone();
                }
        }
+       //setDirty(true);
 
        return *this;
 }
@@ -440,6 +453,7 @@ InventoryItem * InventoryList::changeItem(u32 i, InventoryItem *newitem)
 
        InventoryItem *olditem = m_items[i];
        m_items[i] = newitem;
+       //setDirty(true);
        return olditem;
 }
 
@@ -493,6 +507,8 @@ InventoryItem * InventoryList::addItem(u32 i, InventoryItem *newitem)
        if(newitem == NULL)
                return NULL;
        
+       //setDirty(true);
+       
        // If it is an empty position, it's an easy job.
        InventoryItem *to_item = m_items[i];
        if(to_item == NULL)
@@ -549,6 +565,8 @@ InventoryItem * InventoryList::takeItem(u32 i, u32 count)
 {
        if(count == 0)
                return NULL;
+       
+       //setDirty(true);
 
        InventoryItem *item = m_items[i];
        // If it is an empty position, return NULL