summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-08-12 11:38:08 -0600
committerJared Adams <jaxad0127@gmail.com>2009-08-12 11:38:08 -0600
commitf6296b7d766a20ad7a48f8e4b01ce67402ae2931 (patch)
tree903a4da8f60f6d0e1e239e6eb2f4b4eb74b96406 /src/map/pc.c
parent37bdc8e72ec43e6e8f827ed77a1f93f5a8b0007f (diff)
downloadtmwa-f6296b7d766a20ad7a48f8e4b01ce67402ae2931.tar.gz
tmwa-f6296b7d766a20ad7a48f8e4b01ce67402ae2931.tar.bz2
tmwa-f6296b7d766a20ad7a48f8e4b01ce67402ae2931.tar.xz
tmwa-f6296b7d766a20ad7a48f8e4b01ce67402ae2931.zip
Fix adding equiped items to trade
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c24
1 files changed, 17 insertions, 7 deletions
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�Ȃ�