From a0c7d1f61783e77e552896824855377e4bb43f8d Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Sun, 5 Apr 2009 19:17:33 -0600 Subject: Implement TMWServ's NpcHandler --- src/gui/buy.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'src/gui/buy.cpp') diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp index 7cefa3e5..8d963227 100644 --- a/src/gui/buy.cpp +++ b/src/gui/buy.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" @@ -187,13 +184,9 @@ void BuyDialog::action(const gcn::ActionEvent &event) else if (event.getId() == "buy" && mAmountItems > 0 && mAmountItems <= mMaxItems) { - // Net::getNpcHandler()->buyItem(current_npc, mShopItems->at(selectedItem)->getId(), mAmountItems); -#ifdef TMWSERV_SUPPORT - Net::GameServer::Player::tradeWithNPC - (mShopItems->at(selectedItem)->getId(), mAmountItems); -#else - npcHandler->buyItem(current_npc, mShopItems->at(selectedItem)->getId(), mAmountItems); -#endif + Net::getNpcHandler()->buyItem(current_npc, + mShopItems->at(selectedItem)->getId(), + mAmountItems); // Update money and adjust the max number of items that can be bought mMaxItems -= mAmountItems; -- cgit v1.2.3-70-g09d2