From 761682b6254a3d43e65ff45e07683c61afa6f1e4 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 31 Mar 2012 16:54:22 +0300 Subject: Last part of fixes. --- src/gui/shopwindow.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/gui/shopwindow.cpp') diff --git a/src/gui/shopwindow.cpp b/src/gui/shopwindow.cpp index 01b589ab6..fccb953b6 100644 --- a/src/gui/shopwindow.cpp +++ b/src/gui/shopwindow.cpp @@ -419,6 +419,8 @@ void ShopWindow::saveList() items = mSellShopItems->items(); for (it = items.begin(); it != items.end(); ++it) { + if (!(*it)) + continue; ShopItem *sellItem = *(it); ShopItem *buyItem = mapItems[sellItem->getId()]; @@ -426,7 +428,7 @@ void ShopWindow::saveList() if (buyItem) { shopFile << strprintf(" %d %d ", buyItem->getQuantity(), - buyItem->getPrice()); + buyItem->getPrice()); mapItems.erase(sellItem->getId()); } else @@ -434,11 +436,8 @@ void ShopWindow::saveList() shopFile << " 0 0 "; } - if (sellItem) - { - shopFile << strprintf("%d %d", sellItem->getQuantity(), - sellItem->getPrice()) << std::endl; - } + shopFile << strprintf("%d %d", sellItem->getQuantity(), + sellItem->getPrice()) << std::endl; } std::map::const_iterator mapIt; @@ -682,7 +681,7 @@ void ShopWindow::processRequest(std::string nick, std::string data, int mode) if (!inv) return; - unsigned long idx = 0; + size_t idx = 0; idx = data.find(" "); if (idx == std::string::npos) -- cgit v1.2.3-60-g2f50