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:
shennetsind 2012-07-01 12:29:38 +00:00
parent d0105f816b
commit 32b82f75b8
2 changed files with 16 additions and 5 deletions

View File

@ -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;
}

View File

@ -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;
}