summaryrefslogtreecommitdiff
path: root/src/gui/sell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/sell.cpp')
-rw-r--r--src/gui/sell.cpp27
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();