summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-06-29 23:24:52 +0300
committerAndrei Karas <akaras@inbox.ru>2013-06-29 23:24:52 +0300
commitc7c6894dcede6778f311171f1128024b5ba97d84 (patch)
tree4cd017cc9e96d2532862c18583dda05c53b46bbc /src
parentb6bdc6a3406e4171b3e46c3735b7801edd27dd67 (diff)
downloadManaVerse-c7c6894dcede6778f311171f1128024b5ba97d84.tar.gz
ManaVerse-c7c6894dcede6778f311171f1128024b5ba97d84.tar.bz2
ManaVerse-c7c6894dcede6778f311171f1128024b5ba97d84.tar.xz
ManaVerse-c7c6894dcede6778f311171f1128024b5ba97d84.zip
fix working with protected items by automatic checks.
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/shoplistbox.cpp4
-rw-r--r--src/playerinfo.cpp4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp
index 827bb6755..6516b056f 100644
--- a/src/gui/widgets/shoplistbox.cpp
+++ b/src/gui/widgets/shoplistbox.cpp
@@ -108,8 +108,8 @@ void ShopListBox::draw(gcn::Graphics *gcnGraphics)
gcn::Color* backgroundColor = &mBackgroundColor;
ShopItem *const item = mShopItems->at(i);
- if ((mShopItems && item && mPlayerMoney < item->getPrice()
- && mPriceCheck) || PlayerInfo::isItemProtected(item->getId()))
+ if (item && ((mShopItems && mPlayerMoney < item->getPrice()
+ && mPriceCheck) || PlayerInfo::isItemProtected(item->getId())))
{
if (i != mSelected)
{
diff --git a/src/playerinfo.cpp b/src/playerinfo.cpp
index f2e933a24..4e780f4df 100644
--- a/src/playerinfo.cpp
+++ b/src/playerinfo.cpp
@@ -359,8 +359,10 @@ static void saveProtectedItems()
std::set<int>::const_iterator it = mProtectedItems.begin();
std::set<int>::const_iterator it_end = mProtectedItems.end();
if (it != it_end)
+ {
str.append(toString(*it));
- ++ it;
+ ++ it;
+ }
while (it != it_end)
{
str.append(",").append(toString(*it));