diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-24 19:28:46 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-24 19:28:46 +0300 |
commit | 8764d8fed61e7f0148ede9a6a836b402145578aa (patch) | |
tree | d19a68662f801fcabd378f4b966b048778878e5c /src/gui | |
parent | 81020303571b9421b3ef1c8d2ec5f5d36599540d (diff) | |
download | plus-8764d8fed61e7f0148ede9a6a836b402145578aa.tar.gz plus-8764d8fed61e7f0148ede9a6a836b402145578aa.tar.bz2 plus-8764d8fed61e7f0148ede9a6a836b402145578aa.tar.xz plus-8764d8fed61e7f0148ede9a6a836b402145578aa.zip |
eathena: add support for buy from cash shop.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/windows/buydialog.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp index 33e3932bc..ec83e610c 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/cashshophandler.h" #include "net/markethandler.h" #include "net/npchandler.h" @@ -442,21 +443,28 @@ void BuyDialog::action(const ActionEvent &event) } else if (mNpcId != Nick) { - if (mNpcId != Market) + if (mNpcId == Market) { - npcHandler->buyItem(mNpcId, + marketHandler->buyItem(item->getId(), + item->getType(), + item->getColor(), + mAmountItems); + item->increaseQuantity(-mAmountItems); + item->update(); + } + else if (mNpcId == Cash) + { + cashShopHandler->buyItem(item->getPrice(), item->getId(), item->getColor(), mAmountItems); } else { - marketHandler->buyItem(item->getId(), - item->getType(), + npcHandler->buyItem(mNpcId, + item->getId(), item->getColor(), mAmountItems); - item->increaseQuantity(-mAmountItems); - item->update(); } // Update money and adjust the max number of items |