summaryrefslogtreecommitdiff
path: root/src/map/mail.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2014-01-23 19:35:01 +0100
committerHaru <haru@dotalux.com>2015-06-01 10:11:40 +0200
commitad958235cfc56b86da89bdc2aa1e5155b0c006a1 (patch)
tree8b5d66a4620d28edeeefae1aec67881b98ac0530 /src/map/mail.c
parent42e1df9e61f8efb6340ed1c9238cd247d553d9b8 (diff)
downloadhercules-ad958235cfc56b86da89bdc2aa1e5155b0c006a1.tar.gz
hercules-ad958235cfc56b86da89bdc2aa1e5155b0c006a1.tar.bz2
hercules-ad958235cfc56b86da89bdc2aa1e5155b0c006a1.tar.xz
hercules-ad958235cfc56b86da89bdc2aa1e5155b0c006a1.zip
Replaced some of the hardcoded values with constants (map)
- Replaced several hardcoded values with the appropriate enums. - Added documentation for some hardcoded values that haven't been replaced by enums (yet) - Minor code legibility improvements. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/mail.c')
-rw-r--r--src/map/mail.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/map/mail.c b/src/map/mail.c
index 7ba7d7470..d7ce9c830 100644
--- a/src/map/mail.c
+++ b/src/map/mail.c
@@ -14,6 +14,7 @@
#include "itemdb.h"
#include "log.h"
#include "pc.h"
+#include "storage.h"
#include "../common/nullpo.h"
#include "../common/showmsg.h"
@@ -36,7 +37,7 @@ int mail_removeitem(struct map_session_data *sd, short flag)
if( sd->mail.amount )
{
if (flag) // Item send
- pc->delitem(sd, sd->mail.index, sd->mail.amount, 1, 0, LOG_TYPE_MAIL);
+ pc->delitem(sd, sd->mail.index, sd->mail.amount, 1, DELITEM_NORMAL, LOG_TYPE_MAIL);
else
clif->additem(sd, sd->mail.index, sd->mail.amount, 0);
}
@@ -151,7 +152,7 @@ int mail_openmail(struct map_session_data *sd)
{
nullpo_ret(sd);
- if( sd->state.storage_flag || sd->state.vending || sd->state.buyingstore || sd->state.trading )
+ if (sd->state.storage_flag != STORAGE_FLAG_CLOSED || sd->state.vending || sd->state.buyingstore || sd->state.trading)
return 0;
clif->mail_window(sd->fd, 0);