Fixed bugreport:5984 rental items exploit which allowed a rental item from never being deleted when used alongside storage has been fixed, blame on r14958
git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16361 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
parent
d0105f816b
commit
32b82f75b8
18
src/map/pc.c
18
src/map/pc.c
@ -3761,11 +3761,25 @@ int pc_additem(struct map_session_data *sd,struct item *item_data,int amount,e_l
|
||||
clif_additem(sd,i,amount,0);
|
||||
}
|
||||
log_pick_pc(sd, log_type, amount, &sd->status.inventory[i]);
|
||||
|
||||
|
||||
sd->weight += w;
|
||||
clif_updatestatus(sd,SP_WEIGHT);
|
||||
//Auto-equip
|
||||
if(data->flag.autoequip) pc_equipitem(sd, i, data->equip);
|
||||
if(data->flag.autoequip)
|
||||
pc_equipitem(sd, i, data->equip);
|
||||
|
||||
/* rental item check */
|
||||
if( item_data->expire_time ) {
|
||||
if( time(NULL) > item_data->expire_time ) {
|
||||
clif_rental_expired(sd->fd, i, sd->status.inventory[i].nameid);
|
||||
pc_delitem(sd, i, sd->status.inventory[i].amount, 1, 0, LOG_TYPE_OTHER);
|
||||
} else {
|
||||
int seconds = (int)( item_data->expire_time - time(NULL) );
|
||||
clif_rental_time(sd->fd, sd->status.inventory[i].nameid, seconds);
|
||||
pc_inventory_rental_add(sd, seconds);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -6102,9 +6102,6 @@ BUILDIN_FUNC(rentitem)
|
||||
clif_additem(sd, 0, 0, flag);
|
||||
return 1;
|
||||
}
|
||||
|
||||
clif_rental_time(sd->fd, nameid, seconds);
|
||||
pc_inventory_rental_add(sd, seconds);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user