diff options
author | Skotlex <Skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-08-19 15:46:55 +0000 |
---|---|---|
committer | Skotlex <Skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-08-19 15:46:55 +0000 |
commit | af7c783667e77887131d186f51fb60f7dc31b87c (patch) | |
tree | 7b9be10c508ee9a1fcfea8e661fa376b0ff8a8f3 /src/map/pc.c | |
parent | fe89d7ef6e558134e58c95ddcbbe9f4f362c4119 (diff) | |
download | hercules-af7c783667e77887131d186f51fb60f7dc31b87c.tar.gz hercules-af7c783667e77887131d186f51fb60f7dc31b87c.tar.bz2 hercules-af7c783667e77887131d186f51fb60f7dc31b87c.tar.xz hercules-af7c783667e77887131d186f51fb60f7dc31b87c.zip |
- Implemented usage of packets 0x7fa and 0x7f7, 0x7f8, 0x7f9. These are used for proper deletion of items as well as movement/spawn packets for Renewal clients.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14383 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 70a433c0e..f31442d28 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -339,7 +339,7 @@ void pc_inventory_rentals(struct map_session_data *sd) if( sd->status.inventory[i].expire_time <= time(NULL) ) { clif_rental_expired(sd->fd, sd->status.inventory[i].nameid); - pc_delitem(sd, i, sd->status.inventory[i].amount, 0); + pc_delitem(sd, i, sd->status.inventory[i].amount, 0, 0); } else { @@ -3124,7 +3124,7 @@ int pc_insert_card(struct map_session_data* sd, int idx_card, int idx_equip) // remember the card id to insert nameid = sd->status.inventory[idx_card].nameid; - if( pc_delitem(sd,idx_card,1,1) == 1 ) + if( pc_delitem(sd,idx_card,1,1,0) == 1 ) {// failed clif_insert_card(sd,idx_equip,idx_card,1); } @@ -3378,7 +3378,7 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount) /*========================================== * アイテムを減らす *------------------------------------------*/ -int pc_delitem(struct map_session_data *sd,int n,int amount,int type) +int pc_delitem(struct map_session_data *sd,int n,int amount,int type, short reason) { nullpo_retr(1, sd); @@ -3394,7 +3394,7 @@ int pc_delitem(struct map_session_data *sd,int n,int amount,int type) sd->inventory_data[n] = NULL; } if(!(type&1)) - clif_delitem(sd,n,amount); + clif_delitem(sd,n,amount,reason); if(!(type&2)) clif_updatestatus(sd,SP_WEIGHT); @@ -3442,7 +3442,7 @@ int pc_dropitem(struct map_session_data *sd,int n,int amount) if (!map_addflooritem(&sd->status.inventory[n], amount, sd->bl.m, sd->bl.x, sd->bl.y, 0, 0, 0, 2)) return 0; - pc_delitem(sd, n, amount, 0); + pc_delitem(sd, n, amount, 0, 7); return 1; } @@ -3705,7 +3705,7 @@ int pc_useitem(struct map_session_data *sd,int n) if( log_config.enable_logs&0x100 ) log_pick_pc(sd, "C", sd->status.inventory[n].nameid, -1, &sd->status.inventory[n]); - pc_delitem(sd,n,1,1); // Rental Usable Items are not deleted until expiration + pc_delitem(sd,n,1,1,0); // Rental Usable Items are not deleted until expiration } else clif_useitemack(sd,n,0,0); @@ -3826,7 +3826,7 @@ int pc_putitemtocart(struct map_session_data *sd,int idx,int amount) return 1; if( pc_cart_additem(sd,item_data,amount) == 0 ) - return pc_delitem(sd,idx,amount,0); + return pc_delitem(sd,idx,amount,0,5); return 1; } @@ -7230,7 +7230,7 @@ int pc_checkitem(struct map_session_data *sd) if( battle_config.item_check && !itemdb_available(id) ) { ShowWarning("illegal item id %d in %d[%s] inventory.\n",id,sd->bl.id,sd->status.name); - pc_delitem(sd,i,sd->status.inventory[i].amount,3); + pc_delitem(sd,i,sd->status.inventory[i].amount,3,0); continue; } if( i > j ) @@ -7409,9 +7409,9 @@ int pc_divorce(struct map_session_data *sd) for( i = 0; i < MAX_INVENTORY; i++ ) { if( sd->status.inventory[i].nameid == WEDDING_RING_M || sd->status.inventory[i].nameid == WEDDING_RING_F ) - pc_delitem(sd, i, 1, 0); + pc_delitem(sd, i, 1, 0, 0); if( p_sd->status.inventory[i].nameid == WEDDING_RING_M || p_sd->status.inventory[i].nameid == WEDDING_RING_F ) - pc_delitem(p_sd, i, 1, 0); + pc_delitem(p_sd, i, 1, 0, 0); } clif_divorced(sd, p_sd->status.name); |