diff options
Diffstat (limited to 'src/inventory.cpp')
-rw-r--r-- | src/inventory.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/inventory.cpp b/src/inventory.cpp index 4766524dd..cecef01a0 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -831,6 +831,7 @@ Inventory::~Inventory() void Inventory::clear() { + m_dirty = true; for(u32 i=0; i<m_lists.size(); i++) { delete m_lists[i]; @@ -840,6 +841,7 @@ void Inventory::clear() void Inventory::clearContents() { + m_dirty = true; for(u32 i=0; i<m_lists.size(); i++) { InventoryList *list = m_lists[i]; @@ -852,12 +854,14 @@ void Inventory::clearContents() Inventory::Inventory(IItemDefManager *itemdef) { + m_dirty = false; m_itemdef = itemdef; } Inventory::Inventory(const Inventory &other) { *this = other; + m_dirty = false; } Inventory & Inventory::operator = (const Inventory &other) @@ -865,6 +869,7 @@ Inventory & Inventory::operator = (const Inventory &other) // Gracefully handle self assignment if(this != &other) { + m_dirty = true; clear(); m_itemdef = other.m_itemdef; for(u32 i=0; i<other.m_lists.size(); i++) @@ -945,6 +950,7 @@ void Inventory::deSerialize(std::istream &is) InventoryList * Inventory::addList(const std::string &name, u32 size) { + m_dirty = true; s32 i = getListIndex(name); if(i != -1) { @@ -990,6 +996,7 @@ bool Inventory::deleteList(const std::string &name) s32 i = getListIndex(name); if(i == -1) return false; + m_dirty = true; delete m_lists[i]; m_lists.erase(m_lists.begin() + i); return true; |