* Rental items no longer expire in cart and storage. The packet does not support this and rentals cannot be put in on official either (since r14082, related r14083).
- Corrected packet 0x299 (ZC_CASH_ITEM_DELETE) missing inventory index field (since r13370). git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14958 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
Date Added
|
||||
|
||||
2011/09/17
|
||||
* Fixed missing edits for cash shop support for clients 2007-07-10aSakexe and older (follow up to r14932).
|
||||
* Rental items no longer expire in cart and storage. The packet does not support this and rentals cannot be put in on official either (since r14082, related r14083). [Ai4rei]
|
||||
- Corrected packet 0x299 (ZC_CASH_ITEM_DELETE) missing inventory index field (since r13370).
|
||||
* Fixed missing edits for cash shop support for clients 2007-07-10aSakexe and older (follow up to r14932). [Ai4rei]
|
||||
2011/09/08
|
||||
* Fix C++ compilation issues. [FlavioJS]
|
||||
2011/09/05
|
||||
|
||||
@@ -13865,11 +13865,14 @@ void clif_rental_time(int fd, int nameid, int seconds)
|
||||
WFIFOSET(fd,8);
|
||||
}
|
||||
|
||||
void clif_rental_expired(int fd, int nameid)
|
||||
|
||||
/// Deletes a rental item from client's inventory (ZC_CASH_ITEM_DELETE).
|
||||
/// 0299 <index>.W <nameid>.W
|
||||
void clif_rental_expired(int fd, int index, int nameid)
|
||||
{ // '<ItemName>' item has been deleted from the Inventory
|
||||
WFIFOHEAD(fd,6);
|
||||
WFIFOW(fd,0) = 0x0299;
|
||||
WFIFOW(fd,2) = 0;
|
||||
WFIFOW(fd,2) = index+2;
|
||||
WFIFOW(fd,4) = nameid;
|
||||
WFIFOSET(fd,6);
|
||||
}
|
||||
|
||||
@@ -585,7 +585,7 @@ void clif_mercenary_updatestatus(struct map_session_data *sd, int type);
|
||||
|
||||
// RENTAL SYSTEM
|
||||
void clif_rental_time(int fd, int nameid, int seconds);
|
||||
void clif_rental_expired(int fd, int nameid);
|
||||
void clif_rental_expired(int fd, int index, int nameid);
|
||||
|
||||
// BOOK READING
|
||||
void clif_readbook(int fd, int book_id, int page);
|
||||
|
||||
46
src/map/pc.c
46
src/map/pc.c
@@ -335,8 +335,8 @@ void pc_inventory_rentals(struct map_session_data *sd)
|
||||
|
||||
if( sd->status.inventory[i].expire_time <= time(NULL) )
|
||||
{
|
||||
clif_rental_expired(sd->fd, sd->status.inventory[i].nameid);
|
||||
pc_delitem(sd, i, sd->status.inventory[i].amount, 0, 0);
|
||||
clif_rental_expired(sd->fd, i, sd->status.inventory[i].nameid);
|
||||
pc_delitem(sd, i, sd->status.inventory[i].amount, 1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -347,48 +347,6 @@ void pc_inventory_rentals(struct map_session_data *sd)
|
||||
}
|
||||
}
|
||||
|
||||
for( i = 0; i < MAX_CART; i++ )
|
||||
{ // Check for Rentals on Cart
|
||||
if( sd->status.cart[i].nameid == 0 )
|
||||
continue; // Nothing here
|
||||
if( sd->status.cart[i].expire_time == 0 )
|
||||
continue;
|
||||
|
||||
if( sd->status.cart[i].expire_time <= time(NULL) )
|
||||
{
|
||||
clif_rental_expired(sd->fd, sd->status.cart[i].nameid);
|
||||
pc_cart_delitem(sd, i, 1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
expire_tick = (unsigned int)(sd->status.cart[i].expire_time - time(NULL)) * 1000;
|
||||
clif_rental_time(sd->fd, sd->status.cart[i].nameid, (int)(expire_tick / 1000));
|
||||
next_tick = min(expire_tick, next_tick);
|
||||
c++;
|
||||
}
|
||||
}
|
||||
|
||||
for( i = 0; i < MAX_STORAGE; i++ )
|
||||
{ // Check for Rentals on Storage
|
||||
if( sd->status.storage.items[i].nameid == 0 )
|
||||
continue;
|
||||
if( sd->status.storage.items[i].expire_time == 0 )
|
||||
continue;
|
||||
|
||||
if( sd->status.storage.items[i].expire_time <= time(NULL) )
|
||||
{
|
||||
clif_rental_expired(sd->fd, sd->status.storage.items[i].nameid);
|
||||
storage_delitem(sd, i, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
expire_tick = (unsigned int)(sd->status.storage.items[i].expire_time - time(NULL)) * 1000;
|
||||
clif_rental_time(sd->fd, sd->status.storage.items[i].nameid, (int)(expire_tick / 1000));
|
||||
next_tick = min(expire_tick, next_tick);
|
||||
c++;
|
||||
}
|
||||
}
|
||||
|
||||
if( c > 0 ) // min(next_tick,3600000) 1 hour each timer to keep announcing to the owner, and to avoid a but with rental time > 15 days
|
||||
sd->rental_timer = add_timer(gettick() + min(next_tick,3600000), pc_inventory_rental_end, sd->bl.id, 0);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user