]> git.lizzy.rs Git - minetest.git/blobdiff - src/inventory.h
Add NodeResolver and clean up node name -> content ID resolution system
[minetest.git] / src / inventory.h
index 52b776db34684bd4a9dff6e7178e0eec959b446d..d21a5dedab29cf09e2abcdb5280aa416bfad1fc0 100644 (file)
@@ -279,18 +279,30 @@ class Inventory
        // A shorthand for adding items. Returns leftover item (possibly empty).
        ItemStack addItem(const std::string &listname, const ItemStack &newitem)
        {
+               m_dirty = true;
                InventoryList *list = getList(listname);
                if(list == NULL)
                        return newitem;
                return list->addItem(newitem);
        }
-       
+
+       bool checkModified() const
+       {
+               return m_dirty;
+       }
+
+       void setModified(const bool x)
+       {
+               m_dirty = x;
+       }
+
 private:
        // -1 if not found
        const s32 getListIndex(const std::string &name) const;
 
        std::vector<InventoryList*> m_lists;
        IItemDefManager *m_itemdef;
+       bool m_dirty;
 };
 
 #endif