summaryrefslogtreecommitdiff
path: root/src/gui/shopwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-03-31 16:54:22 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-01 03:56:16 +0300
commit761682b6254a3d43e65ff45e07683c61afa6f1e4 (patch)
tree2ee462840f3aadb1e96bfa5c6784ec2cc0d2861a /src/gui/shopwindow.cpp
parenta39f63cdfa5ce15b22f294a8bb1db3a036ce462d (diff)
downloadmanaverse-761682b6254a3d43e65ff45e07683c61afa6f1e4.tar.gz
manaverse-761682b6254a3d43e65ff45e07683c61afa6f1e4.tar.bz2
manaverse-761682b6254a3d43e65ff45e07683c61afa6f1e4.tar.xz
manaverse-761682b6254a3d43e65ff45e07683c61afa6f1e4.zip
Last part of fixes.
Diffstat (limited to 'src/gui/shopwindow.cpp')
-rw-r--r--src/gui/shopwindow.cpp13
1 files changed, 6 insertions, 7 deletions
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<int, ShopItem*>::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)