From e9c9b66ae92f4b95061d2b93e5db182d0c80b526 Mon Sep 17 00:00:00 2001 From: ShadowNinja Date: Tue, 2 Sep 2014 12:53:20 -0400 Subject: Make players check inventory modification properly --- src/inventory.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/inventory.h') diff --git a/src/inventory.h b/src/inventory.h index 52b776db3..d21a5deda 100644 --- a/src/inventory.h +++ b/src/inventory.h @@ -279,18 +279,30 @@ public: // 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 m_lists; IItemDefManager *m_itemdef; + bool m_dirty; }; #endif -- cgit v1.2.3