diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-23 23:48:23 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-23 23:48:23 +0300 |
commit | ff287c2b0b763089d4eb271fde7e1cfc7904d29d (patch) | |
tree | 000c614b60063562398dd91f1e57617182c5f43d /src/gui | |
parent | 0df885ac72a9dc05aae9e9029c32c708a5c2322e (diff) | |
download | manaverse-ff287c2b0b763089d4eb271fde7e1cfc7904d29d.tar.gz manaverse-ff287c2b0b763089d4eb271fde7e1cfc7904d29d.tar.bz2 manaverse-ff287c2b0b763089d4eb271fde7e1cfc7904d29d.tar.xz manaverse-ff287c2b0b763089d4eb271fde7e1cfc7904d29d.zip |
In market decrease visible amount after buy something.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/windows/buydialog.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp index 3503bed44..ac3c9e588 100644 --- a/src/gui/windows/buydialog.cpp +++ b/src/gui/windows/buydialog.cpp @@ -434,15 +434,14 @@ void BuyDialog::action(const ActionEvent &event) } else if (eventId == "buy" && mAmountItems > 0 && mAmountItems <= mMaxItems) { + ShopItem *const item = mShopItems->at(selectedItem); if (mNpcId == -2) { - const ShopItem *const item = mShopItems->at(selectedItem); adminHandler->createItems(item->getId(), mAmountItems, item->getColor()); } else if (mNpcId != -1) { - const ShopItem *const item = mShopItems->at(selectedItem); if (mNpcId != -3) { npcHandler->buyItem(mNpcId, @@ -456,6 +455,8 @@ void BuyDialog::action(const ActionEvent &event) item->getType(), item->getColor(), mAmountItems); + item->increaseQuantity(-mAmountItems); + item->update(); } // Update money and adjust the max number of items @@ -471,7 +472,6 @@ void BuyDialog::action(const ActionEvent &event) } else if (tradeWindow) { - const ShopItem *const item = mShopItems->at(selectedItem); if (item) { buySellHandler->sendBuyRequest(mNick, |