Jump to content
  • 0
Sign in to follow this  
Hadeszeus

Rental item problem with cards

Question

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 by Hadeszeus

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

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 by Angelmelody

Share this post


Link to post
Share on other sites
  • 0

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 by Zirius

Share this post


Link to post
Share on other sites
  • 0

 

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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.