diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-08-14 12:10:41 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-08-14 12:10:41 +0000 |
commit | f048a4dd4add4a710bb15f77eaedad93f625b0c4 (patch) | |
tree | 46849986ed36a23f9a386b0475eb8e7c4a4f3f68 /src/gui/sell.cpp | |
parent | b9772c8575708a9f28d89b3b973af73e382e9329 (diff) | |
download | mana-f048a4dd4add4a710bb15f77eaedad93f625b0c4.tar.gz mana-f048a4dd4add4a710bb15f77eaedad93f625b0c4.tar.bz2 mana-f048a4dd4add4a710bb15f77eaedad93f625b0c4.tar.xz mana-f048a4dd4add4a710bb15f77eaedad93f625b0c4.zip |
Enabled buying and selling from NPCs.
Diffstat (limited to 'src/gui/sell.cpp')
-rw-r--r-- | src/gui/sell.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp index 53746248..b601d70c 100644 --- a/src/gui/sell.cpp +++ b/src/gui/sell.cpp @@ -35,10 +35,9 @@ #include "../item.h" #include "../npc.h" - -#include "../resources/iteminfo.h" +#include "../net/gameserver/player.h" #include "../resources/itemdb.h" - +#include "../resources/iteminfo.h" #include "../utils/tostring.h" SellDialog::SellDialog(): @@ -177,14 +176,8 @@ void SellDialog::action(const gcn::ActionEvent &event) else if (event.getId() == "sell" && mAmountItems > 0 && mAmountItems <= mMaxItems) { - // Attempt sell - // XXX Convert for new server - /* - MessageOut outMsg(CMSG_NPC_SELL_REQUEST); - outMsg.writeShort(8); - outMsg.writeShort(mShopItems->at(selectedItem).index); - outMsg.writeShort(mAmountItems); - */ + Net::GameServer::Player::tradeWithNPC + (mShopItems->at(selectedItem).id, mAmountItems); mMaxItems -= mAmountItems; mShopItems->getShop()->at(selectedItem).quantity = mMaxItems; |