diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-07-20 13:03:01 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-07-20 13:03:01 +0300 |
commit | 00dcbde760c522405ba94fbff747c7d8e083c811 (patch) | |
tree | dcc73ffb75d94e5569ec11aca3d7923240d9817e /src/gui | |
parent | 2008152818c796daf526a874d18a7e77c87d423c (diff) | |
download | manaverse-00dcbde760c522405ba94fbff747c7d8e083c811.tar.gz manaverse-00dcbde760c522405ba94fbff747c7d8e083c811.tar.bz2 manaverse-00dcbde760c522405ba94fbff747c7d8e083c811.tar.xz manaverse-00dcbde760c522405ba94fbff747c7d8e083c811.zip |
Some bugfix in item creation logic.
not show items with id < 500.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/buydialog.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gui/buydialog.cpp b/src/gui/buydialog.cpp index 6c9cc0bd7..03d101c87 100644 --- a/src/gui/buydialog.cpp +++ b/src/gui/buydialog.cpp @@ -194,7 +194,7 @@ BuyDialog::BuyDialog() : Window(_("Create items"), false, nullptr, "buy.xml"), gcn::ActionListener(), gcn::SelectionListener(), - mNpcId(0), mMoney(0), mAmountItems(0), mMaxItems(0), mNick(), + mNpcId(-2), mMoney(0), mAmountItems(0), mMaxItems(0), mNick(), mSortModel(nullptr), mSortDropDown(nullptr) { @@ -267,7 +267,7 @@ void BuyDialog::init() // You may change this symbol if your language uses another. mDecreaseButton = new Button(this, _("-"), "dec", this); // TRANSLATORS: buy dialog button - mBuyButton = new Button(this, mNpcId == 0 + mBuyButton = new Button(this, mNpcId == -2 ? _("Create") :_("Buy"), "buy", this); // TRANSLATORS: buy dialog button mQuitButton = new Button(this, _("Quit"), "quit", this); @@ -433,7 +433,7 @@ void BuyDialog::action(const gcn::ActionEvent &event) } else if (eventId == "buy" && mAmountItems > 0 && mAmountItems <= mMaxItems) { - if (!mNpcId) + if (mNpcId == -2) { const ShopItem *const item = mShopItems->at(selectedItem); Net::getAdminHandler()->createItems(item->getId(), @@ -498,7 +498,7 @@ void BuyDialog::updateButtonsAndLabels() const int itemPrice = item->getPrice(); // Calculate how many the player can afford - if (!mNpcId) + if (mNpcId == -2) mMaxItems = 100; else if (itemPrice) mMaxItems = mMoney / itemPrice; |