From 429e82f91487d48ecb5a1742ec6fb6987a2bc9bd Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Wed, 6 May 2009 08:22:19 -0600 Subject: Remove more inventory handling support #ifdefs This also fixes some minor bugs and centralizes some logic. --- src/localplayer.cpp | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'src/localplayer.cpp') diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 11c142cc..afd7f0eb 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -348,15 +348,7 @@ void LocalPlayer::inviteToParty(Player *player) void LocalPlayer::moveInvItem(Item *item, int newIndex) { - // special case, the old and new cannot copy over each other. - if (item->getInvIndex() == newIndex) - return; - -#ifdef TMWSERV_SUPPORT - Net::GameServer::Player::moveItem( - item->getInvIndex(), newIndex, item->getQuantity()); -#endif - // TODO: eAthena support + Net::getInventoryHandler()->moveItem(item->getInvIndex(), newIndex); } void LocalPlayer::equipItem(Item *item) @@ -386,17 +378,10 @@ void LocalPlayer::dropItem(Item *item, int quantity) Net::getInventoryHandler()->dropItem(item, quantity); } -#ifdef TMWSERV_SUPPORT void LocalPlayer::splitItem(Item *item, int quantity) { - int newIndex = mInventory->getFreeSlot(); - if (newIndex > Inventory::NO_SLOT_INDEX) - { - Net::GameServer::Player::moveItem( - item->getInvIndex(), newIndex, quantity); - } + Net::getInventoryHandler()->splitItem(item, quantity); } -#endif void LocalPlayer::pickUp(FloorItem *item) { -- cgit v1.2.3-70-g09d2