summaryrefslogtreecommitdiff
path: root/src/map/mail.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-11-16 16:14:30 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-11-16 16:14:30 +0000
commit8d5fe8a2562df4eb5e6eca2fb161514d9f6a7e9d (patch)
tree8d024104aa15ed6c2aa5070bd03ed7790a2afd90 /src/map/mail.c
parent9b1e41499d17bb424414a7821e74a53c6d3e3f74 (diff)
downloadhercules-8d5fe8a2562df4eb5e6eca2fb161514d9f6a7e9d.tar.gz
hercules-8d5fe8a2562df4eb5e6eca2fb161514d9f6a7e9d.tar.bz2
hercules-8d5fe8a2562df4eb5e6eca2fb161514d9f6a7e9d.tar.xz
hercules-8d5fe8a2562df4eb5e6eca2fb161514d9f6a7e9d.zip
- Item Rental System.
Script Usage: - rentitem <itemid>,<seconds>; - rentitem <itemname>,<seconds>; git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13370 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mail.c')
-rw-r--r--src/map/mail.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/map/mail.c b/src/map/mail.c
index d77dbe6b4..072368838 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -69,16 +69,14 @@ int mail_removezeny(struct map_session_data *sd, short flag)
unsigned char mail_setitem(struct map_session_data *sd, int idx, int amount)
{
- if (idx == 0)
+ if( idx == 0 )
{ // Zeny Transfer
- if( amount < 0 )
- return 0;
+ if( amount < 0 || !pc_can_give_items(pc_isGM(sd)) )
+ return 1;
+
if( amount > sd->status.zeny )
amount = sd->status.zeny;
- if( !pc_can_give_items(pc_isGM(sd)) )
- amount = 0;
-
sd->mail.zeny = amount;
// clif_updatestatus(sd, SP_ZENY);
return 0;
@@ -94,6 +92,8 @@ unsigned char mail_setitem(struct map_session_data *sd, int idx, int amount)
return 1;
if( !pc_candrop(sd, &sd->status.inventory[idx]) )
return 1;
+ if( sd->status.inventory[idx].expire_time )
+ return 1; // Rental System
sd->mail.index = idx;
sd->mail.nameid = sd->status.inventory[idx].nameid;
@@ -174,7 +174,7 @@ void mail_deliveryfail(struct map_session_data *sd, struct mail_message *msg)
nullpo_retv(sd);
nullpo_retv(msg);
- // Item recieve (due to failure)
+ // Item recieve (due to failure)
if(log_config.enable_logs&0x2000)
log_pick_pc(sd, "E", msg->item.nameid, msg->item.amount, &msg->item);