From 2c1be5a6e7b99dd1c2a7295d4857875dcb83fcc3 Mon Sep 17 00:00:00 2001 From: darkrose Date: Tue, 24 Feb 2015 17:15:50 +1000 Subject: [PATCH] don't free and reallocate inventory items for no reason --- src/inventory.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/inventory.cpp b/src/inventory.cpp index 218b0c7..a225519 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -440,13 +440,8 @@ void InventoryList::deSerialize(std::istream &is) } if (m_items[item_i] != NULL) { if (m_items[item_i]->getContent() == c) { - if ((c&CONTENT_TOOLITEM_MASK) == CONTENT_TOOLITEM_MASK) { - ((ToolItem*)m_items[item_i++])->setWear(wear); - }else if ((c&CONTENT_CLOTHESITEM_MASK) == CONTENT_CLOTHESITEM_MASK) { - ((ClothesItem*)m_items[item_i++])->setWear(wear); - }else{ - m_items[item_i++]->setCount(count); - } + m_items[item_i]->setWear(wear); + m_items[item_i++]->setCount(count); continue; } delete m_items[item_i];