Allow full circle rotation with 2degs step for plantlike drawtype.
[oweals/minetest.git] / src / inventory.cpp
index 928021c2ff94db349c716d92411cd648f361a24f..4b1beb230c6a90fbe9dd71b463a433fb6d5638be 100644 (file)
@@ -175,7 +175,7 @@ void ItemStack::deSerialize(std::istream &is, IItemDefManager *itemdef)
                // Convert old materials
                if(material <= 0xff)
                        material = content_translate_from_19_to_internal(material);
-               if(material > MAX_CONTENT)
+               if(material > 0xfff)
                        throw SerializationError("Too large material number");
                // Convert old id to name
                NameIdMapping legacy_nimap;
@@ -194,7 +194,7 @@ void ItemStack::deSerialize(std::istream &is, IItemDefManager *itemdef)
                is>>material;
                u16 materialcount;
                is>>materialcount;
-               if(material > MAX_CONTENT)
+               if(material > 0xfff)
                        throw SerializationError("Too large material number");
                // Convert old id to name
                NameIdMapping legacy_nimap;
@@ -562,7 +562,7 @@ InventoryList & InventoryList::operator = (const InventoryList &other)
        return *this;
 }
 
-bool InventoryList::operator == (const InventoryList &other)
+bool InventoryList::operator == (const InventoryList &other) const
 {
        if(m_size != other.m_size)
                return false;
@@ -875,14 +875,14 @@ Inventory & Inventory::operator = (const Inventory &other)
        return *this;
 }
 
-bool Inventory::operator == (const Inventory &other)
+bool Inventory::operator == (const Inventory &other) const
 {
        if(m_lists.size() != other.m_lists.size())
                return false;
 
        for(u32 i=0; i<m_lists.size(); i++)
        {
-               if(m_lists[i] != other.m_lists[i])
+               if(*m_lists[i] != *other.m_lists[i])
                        return false;
        }
        return true;
@@ -957,6 +957,9 @@ InventoryList * Inventory::addList(const std::string &name, u32 size)
        }
        else
        {
+               //don't create list with invalid name
+               if (name.find(" ") != std::string::npos) return NULL;
+
                InventoryList *list = new InventoryList(name, size, m_itemdef);
                m_lists.push_back(list);
                return list;