diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-04-05 19:17:33 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-04-05 19:17:33 -0600 |
commit | a0c7d1f61783e77e552896824855377e4bb43f8d (patch) | |
tree | e952181b83482abeffbd8ad9c62789b8f72e42e5 /src/gui/sell.cpp | |
parent | 9113afb868f6c1da5911437d3ddabdcf169cbec2 (diff) | |
download | mana-client-a0c7d1f61783e77e552896824855377e4bb43f8d.tar.gz mana-client-a0c7d1f61783e77e552896824855377e4bb43f8d.tar.bz2 mana-client-a0c7d1f61783e77e552896824855377e4bb43f8d.tar.xz mana-client-a0c7d1f61783e77e552896824855377e4bb43f8d.zip |
Implement TMWServ's NpcHandler
Diffstat (limited to 'src/gui/sell.cpp')
-rw-r--r-- | src/gui/sell.cpp | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp index 3b4e9982..2dfc66a7 100644 --- a/src/gui/sell.cpp +++ b/src/gui/sell.cpp @@ -34,11 +34,8 @@ #include "shopitem.h" #include "units.h" -#ifdef TMWSERV_SUPPORT -#include "net/tmwserv/gameserver/player.h" -#else -#include "net/ea/npchandler.h" -#endif +#include "net/net.h" +#include "net/npchandler.h" #include "resources/iteminfo.h" @@ -129,16 +126,6 @@ void SellDialog::reset() updateButtonsAndLabels(); } -#ifdef TMWSERV_SUPPORT - -void SellDialog::addItem(int item, int amount, int price) -{ - mShopItems->addItem(item, amount, price); - mShopItemList->adjustSize(); -} - -#else - void SellDialog::addItem(const Item *item, int price) { if (!item) @@ -150,8 +137,6 @@ void SellDialog::addItem(const Item *item, int price) mShopItemList->adjustSize(); } -#endif - void SellDialog::action(const gcn::ActionEvent &event) { if (event.getId() == "quit") @@ -195,10 +180,6 @@ void SellDialog::action(const gcn::ActionEvent &event) else if (event.getId() == "sell" && mAmountItems > 0 && mAmountItems <= mMaxItems) { -#ifdef TMWSERV_SUPPORT - Net::GameServer::Player::tradeWithNPC - (mShopItems->at(selectedItem)->getId(), mAmountItems); -#else // Attempt sell ShopItem *item = mShopItems->at(selectedItem); int sellCount; @@ -210,10 +191,8 @@ void SellDialog::action(const gcn::ActionEvent &event) // the inventory index of the next Duplicate otherwise. sellCount = item->sellCurrentDuplicate(mAmountItems); mAmountItems -= sellCount; - // Net::getNpcHandler()->sellItem(current_npc, item->getCurrentInvIndex(), sellCount); - npcHandler->sellItem(current_npc, item->getCurrentInvIndex(), sellCount); + Net::getNpcHandler()->sellItem(current_npc, item->getCurrentInvIndex(), sellCount); } -#endif mPlayerMoney += mAmountItems * mShopItems->at(selectedItem)->getPrice(); |