diff options
author | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-11-07 20:45:16 +0000 |
---|---|---|
committer | zephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-11-07 20:45:16 +0000 |
commit | a31d04361d3bbfa96519ecd2632e09e6fcb26e04 (patch) | |
tree | c3bb81f955b11b88aba7a9fb4b05dfc3c5c3b06f | |
parent | 7496915ff909733618b011ca06ee27ae7a098f2b (diff) | |
download | hercules-a31d04361d3bbfa96519ecd2632e09e6fcb26e04.tar.gz hercules-a31d04361d3bbfa96519ecd2632e09e6fcb26e04.tar.bz2 hercules-a31d04361d3bbfa96519ecd2632e09e6fcb26e04.tar.xz hercules-a31d04361d3bbfa96519ecd2632e09e6fcb26e04.zip |
- Added separated packets for get and set attachment on mail system.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11693 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-Trunk.txt | 1 | ||||
-rw-r--r-- | src/map/clif.c | 22 | ||||
-rw-r--r-- | src/map/clif.h | 1 | ||||
-rw-r--r-- | src/map/intif.c | 3 |
4 files changed, 23 insertions, 4 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 06fa7f509..cefd6531f 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -6,6 +6,7 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 2007/11/07 * Some updates on the mail system packets [Zephyrus] - Corrected the mail database structure on main.sql + - Added separated packets for get and set attachment on mail system. 2007/11/06 * Fixed a crash caused by a mistake in the previous change 2007/11/05 diff --git a/src/map/clif.c b/src/map/clif.c index 068ace525..50c3eee15 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -11298,11 +11298,11 @@ void clif_parse_AutoRevive(int fd, struct map_session_data *sd) *==========================================*/ /*------------------------------------------ - * Reply to an Attachment operation + * Reply to Set Attachment operation * 0 : Successfully attached item to mail * 1 : Fail to set the attachment *------------------------------------------*/ -static void clif_Mail_attachment(int fd, int index, uint8 flag) +static void clif_Mail_setattachment(int fd, int index, uint8 flag) { WFIFOHEAD(fd,packet_len(0x255)); WFIFOW(fd,0) = 0x255; @@ -11312,6 +11312,20 @@ static void clif_Mail_attachment(int fd, int index, uint8 flag) } /*------------------------------------------ + * Reply to Get Attachment operation + * 0 : Successfully added attachment to Inventory + * 1 : Fail to set the item to inventory + * 2 : Weight problems + *------------------------------------------*/ +void clif_Mail_getattachment(int fd, uint8 flag) +{ + WFIFOHEAD(fd,packet_len(0x245)); + WFIFOW(fd,0) = 0x245; + WFIFOB(fd,2) = flag; + WFIFOSET(fd,packet_len(0x245)); +} + +/*------------------------------------------ * Send Mail ack * 0 : Message Send Ok * 1 : Recipient does not exist @@ -11519,7 +11533,7 @@ void clif_parse_Mail_getattach(int fd, struct map_session_data *sd) weight = data->weight * sd->mail.inbox.msg[i].item.amount; if (weight > sd->max_weight - sd->weight) { - // clif_Mail_attachment(fd, 2); + clif_Mail_getattachment(fd, 2); return; } } @@ -11582,7 +11596,7 @@ void clif_parse_Mail_setattach(int fd, struct map_session_data *sd) flag = mail_setitem(sd, idx, amount); if (idx > 0) - clif_Mail_attachment(fd,idx,flag); + clif_Mail_setattachment(fd,idx,flag); } /*------------------------------------------ diff --git a/src/map/clif.h b/src/map/clif.h index 7170b432b..6f3d0f016 100644 --- a/src/map/clif.h +++ b/src/map/clif.h @@ -391,6 +391,7 @@ void clif_Mail_return(int fd, int mail_id, short fail); void clif_Mail_send(int fd, bool fail); void clif_Mail_new(int fd, int mail_id, const char *sender, const char *title); void clif_Mail_refreshinbox(struct map_session_data *sd); +void clif_Mail_getattachment(int fd, uint8 flag); #endif #endif /* _CLIF_H_ */ diff --git a/src/map/intif.c b/src/map/intif.c index d54441f4e..089d776f6 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -1568,7 +1568,10 @@ int intif_parse_Mail_getattach(int fd) memcpy(&item, RFIFOP(fd,12), sizeof(struct item)); if (item.nameid > 0 && item.amount > 0) + { pc_additem(sd, &item, item.amount); + clif_Mail_getattachment(sd->fd, 0); + } return 0; } |