From f6296b7d766a20ad7a48f8e4b01ce67402ae2931 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Wed, 12 Aug 2009 11:38:08 -0600 Subject: Fix adding equiped items to trade --- src/map/pc.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'src/map/pc.c') diff --git a/src/map/pc.c b/src/map/pc.c index 570ceb6..e0b4c89 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -2948,7 +2948,6 @@ int pc_delitem(struct map_session_data *sd,int n,int amount,int type) */ int pc_dropitem(struct map_session_data *sd,int n,int amount) { - int i; nullpo_retr(1, sd); if (sd->trade_partner != 0 || sd->npc_id != 0 || sd->state.storage_flag) @@ -2960,12 +2959,7 @@ int pc_dropitem(struct map_session_data *sd,int n,int amount) if(amount <= 0) return 0; - for (i = 0; i < 11; i++) { - if (equip_pos[i] > 0 && sd->equip_index[i] == n) { //Slot taken, remove item from there. - pc_unequipitem(sd, sd->equip_index[i], 1); - sd->equip_index[i] = -1; - } - } + pc_unequipinvyitem(sd, n, 1); if (sd->status.inventory[n].nameid <= 0 || @@ -6507,6 +6501,22 @@ int pc_unequipitem(struct map_session_data *sd,int n,int type) return 0; } +int pc_unequipinvyitem(struct map_session_data* sd, int n, int type) +{ + int i; + + nullpo_retr(1, sd); + + for (i = 0; i < 11; i++) { + if (equip_pos[i] > 0 && sd->equip_index[i] == n) { //Slot taken, remove item from there. + pc_unequipitem(sd, sd->equip_index[i], type); + sd->equip_index[i] = -1; + } + } + + return 0; +} + /*========================================== * �A�C�e����index�ԍ����l�߂��� * �� ���i�̑����”\�`�F�b�N���s�Ȃ� -- cgit v1.2.3-70-g09d2