Rental item problem with cards

Hadeszeus

New member
Messages
651
Points
0
Location
Philippines
Can someone share the diff to avoid loosing cards inserted on RENTAL ITEM.
default_sad.png

Right now cards are all gone after expiration data of an item.

 
Last edited by a moderator:
Can someone share the diff to avoid loosing cards inserted on RENTAL ITEM.
default_sad.png


Right now cards are all gone after expiration data of an item.
try this

Code:
--- 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)
 
Last edited by a moderator:
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.

 
Last edited by a moderator:
Can someone share the diff to avoid loosing cards inserted on RENTAL ITEM.
default_sad.png


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.nameid);++ { // expiration return card+ int s,flag =0;+ for (s = 0; s < MAX_SLOTS; s++) {+ if( itemdb->exists(sd->status.inventory.card) != NULL ){+ struct item card_it;+ memset(&card_it,0,sizeof(card_it));+ card_it.nameid=sd->status.inventory.card;+ 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.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

 
Back
Top