From ff287c2b0b763089d4eb271fde7e1cfc7904d29d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 23 Dec 2014 23:48:23 +0300 Subject: In market decrease visible amount after buy something. --- src/gui/windows/buydialog.cpp | 6 +++--- 1 file 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, -- cgit v1.2.3-60-g2f50