summaryrefslogtreecommitdiff
path: root/src/gui/windows/buydialog.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-23 23:48:23 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-23 23:48:23 +0300
commitff287c2b0b763089d4eb271fde7e1cfc7904d29d (patch)
tree000c614b60063562398dd91f1e57617182c5f43d /src/gui/windows/buydialog.cpp
parent0df885ac72a9dc05aae9e9029c32c708a5c2322e (diff)
downloadmanaplus-ff287c2b0b763089d4eb271fde7e1cfc7904d29d.tar.gz
manaplus-ff287c2b0b763089d4eb271fde7e1cfc7904d29d.tar.bz2
manaplus-ff287c2b0b763089d4eb271fde7e1cfc7904d29d.tar.xz
manaplus-ff287c2b0b763089d4eb271fde7e1cfc7904d29d.zip
In market decrease visible amount after buy something.
Diffstat (limited to 'src/gui/windows/buydialog.cpp')
-rw-r--r--src/gui/windows/buydialog.cpp6
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,