summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-24 19:28:46 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-24 19:28:46 +0300
commit8764d8fed61e7f0148ede9a6a836b402145578aa (patch)
treed19a68662f801fcabd378f4b966b048778878e5c /src/gui/windows
parent81020303571b9421b3ef1c8d2ec5f5d36599540d (diff)
downloadmv-8764d8fed61e7f0148ede9a6a836b402145578aa.tar.gz
mv-8764d8fed61e7f0148ede9a6a836b402145578aa.tar.bz2
mv-8764d8fed61e7f0148ede9a6a836b402145578aa.tar.xz
mv-8764d8fed61e7f0148ede9a6a836b402145578aa.zip
eathena: add support for buy from cash shop.
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/buydialog.cpp20
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