summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-09-17 12:44:33 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-09-17 12:44:33 +0000
commit2c1b05e983bc4b1ee565c375c71db8f5a8f19b9c (patch)
tree718eca2778c4371f4b4e6d32c64b75efaa1eb00b /src/map/pc.c
parenta3b5d7d0f3e6724836b411183fa8f7fd0bc5bf8e (diff)
downloadhercules-2c1b05e983bc4b1ee565c375c71db8f5a8f19b9c.tar.gz
hercules-2c1b05e983bc4b1ee565c375c71db8f5a8f19b9c.tar.bz2
hercules-2c1b05e983bc4b1ee565c375c71db8f5a8f19b9c.tar.xz
hercules-2c1b05e983bc4b1ee565c375c71db8f5a8f19b9c.zip
* 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://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14958 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c46
1 files changed, 2 insertions, 44 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 2de4c28de..23605409a 100644
--- a/src/map/pc.c
+++ b/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