~ubuntu-branches/ubuntu/trusty/manaplus/trusty-proposed

« back to all changes in this revision

Viewing changes to src/gui/selldialog.cpp

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi
  • Date: 2013-07-11 10:09:41 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20130711100941-f0rwuvcwgl8ulqo8
Tags: 1.3.7.7.1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#include "gui/selldialog.h"
24
24
 
 
25
#include "playerinfo.h"
25
26
#include "shopitem.h"
26
27
#include "units.h"
27
28
 
228
229
    {
229
230
        if (mNpcId != -1)
230
231
        {
 
232
            ShopItem *const item = mShopItems->at(selectedItem);
 
233
            if (PlayerInfo::isItemProtected(item->getId()))
 
234
                return;
231
235
            if (eventId == "presell")
232
236
            {
233
 
                const ShopItem *const item = mShopItems->at(selectedItem);
234
237
                const ItemInfo &info = ItemDB::get(item->getId());
235
238
                if (info.isProtected())
236
239
                {
239
242
                        _("sell item"),
240
243
                        // TRANSLATORS: sell confirmation message
241
244
                        strprintf(_("Do you really want to sell %s?"),
242
 
                        info.getName().c_str()), false, true);
 
245
                        info.getName().c_str()), SOUND_REQUEST, false, true);
243
246
                    dialog->addActionListener(this);
244
247
                    return;
245
248
                }
246
249
            }
247
250
            // Attempt sell
248
 
            ShopItem *const item = mShopItems->at(selectedItem);
249
251
            mPlayerMoney +=
250
252
                mAmountItems * mShopItems->at(selectedItem)->getPrice();
251
253
            mMaxItems -= mAmountItems;