From c860fb83abb48b98f98e20fc19ac1591d03b61d1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 22 Dec 2014 14:14:26 +0300 Subject: Add support for show and buy from market. --- src/gui/windows/buydialog.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/gui/windows/buydialog.cpp') diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp index dbc6dd59b..61b5d7233 100644 --- a/src/gui/windows/buydialog.cpp +++ b/src/gui/windows/buydialog.cpp @@ -45,6 +45,7 @@ #include "net/adminhandler.h" #include "net/buysellhandler.h" +#include "net/markethandler.h" #include "net/npchandler.h" #include "resources/iteminfo.h" @@ -439,8 +440,19 @@ void BuyDialog::action(const ActionEvent &event) else if (mNpcId != -1) { const ShopItem *const item = mShopItems->at(selectedItem); - npcHandler->buyItem(mNpcId, item->getId(), - item->getColor(), mAmountItems); + if (mNpcId != -3) + { + npcHandler->buyItem(mNpcId, + item->getId(), + item->getColor(), + mAmountItems); + } + else + { + marketHandler->buyItem(item->getId(), + item->getColor(), + mAmountItems); + } // Update money and adjust the max number of items // that can be bought -- cgit v1.2.3-60-g2f50