Hadeszeus 15 Posted August 2, 2014 (edited) Can someone share the diff to avoid loosing cards inserted on RENTAL ITEM. Right now cards are all gone after expiration data of an item. Edited August 2, 2014 by Hadeszeus Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted August 2, 2014 (edited) Can someone share the diff to avoid loosing cards inserted on RENTAL ITEM. Right now cards are all gone after expiration data of an item. try this --- a/src/map/pc.c +++ b/src/map/pc.c @@ -496,6 +496,25 @@ void pc_rental_expire(struct map_session_data *sd, int i) { } clif->rental_expired(sd->fd, i, sd->status.inventory[i].nameid); + + { // expiration return card + int s,flag =0; + for (s = 0; s < MAX_SLOTS; s++) { + if( itemdb->exists(sd->status.inventory[i].card[s]) != NULL ){ + struct item card_it; + memset(&card_it,0,sizeof(card_it)); + card_it.nameid=sd->status.inventory[i].card[s]; + card_it.identify=itemdb->isidentified(card_it.nameid); + if ((flag = pc->additem(sd, &card_it, 1 ,LOG_TYPE_NONE))) + { + clif->additem(sd, 0, 0, flag); + storage->additem(sd,&card_it,1); + + } + } + } + } + pc->delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_OTHER); } void pc_inventory_rentals(struct map_session_data *sd) Edited January 20, 2016 by Angelmelody 4 eKoh, evilpuncker, Zirius and 1 other reacted to this Quote Share this post Link to post Share on other sites
0 Zirius 1 Posted August 2, 2014 (edited) what will happen if the inventory is full? you have a weapon with 4 cards slotted, the weapon expired, you gain 4 cards, 1 card goes to inventory, what happens to the 3 cards? EDIT: Seems like they go to the storage. LOL. Edited August 2, 2014 by Zirius Quote Share this post Link to post Share on other sites
0 Hadeszeus 15 Posted August 4, 2014 Can someone share the diff to avoid loosing cards inserted on RENTAL ITEM. Right now cards are all gone after expiration data of an item. try this --- a/src/map/pc.c+++ b/src/map/pc.c@@ -496,6 +496,25 @@ void pc_rental_expire(struct map_session_data *sd, int i) { } clif->rental_expired(sd->fd, i, sd->status.inventory[i].nameid);++ { // expiration return card+ int s,flag =0;+ for (s = 0; s < MAX_SLOTS; s++) {+ if( itemdb->exists(sd->status.inventory[i].card[s]) != NULL ){+ struct item card_it;+ memset(&card_it,0,sizeof(card_it));+ card_it.nameid=sd->status.inventory[i].card[s];+ card_it.identify=itemdb->isidentified(card_it.nameid);+ if ((flag = pc->additem(sd, &card_it, 1 ,LOG_TYPE_NONE)))+ {+ clif->additem(sd, 0, 0, flag);+ storage->additem(sd,&card_it,1);++ }+ }+ }+ }+ pc->delitem(sd, i, sd->status.inventory[i].amount, 0, 0, LOG_TYPE_OTHER); } void pc_inventory_rentals(struct map_session_data *sd) You're my HERO! THank you so much! as always Quote Share this post Link to post Share on other sites
0 iZeal 5 Posted August 5, 2014 this should be added to the rev. Quote Share this post Link to post Share on other sites
Can someone share the diff to avoid loosing cards inserted on RENTAL ITEM.
Edited by HadeszeusRight now cards are all gone after expiration data of an item.
Share this post
Link to post
Share on other sites