diff options
author | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-01-05 15:34:09 +0000 |
---|---|---|
committer | ultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2009-01-05 15:34:09 +0000 |
commit | 719a3c6f819cdd752d1719d8ed1cf21e47d8bbc5 (patch) | |
tree | e096d34994f74adbd14d6b016346a8c4fd598b9d /src/map/intif.c | |
parent | 91d9a6f88a6eb8dea142a1c6bdb20385fa8a3721 (diff) | |
download | hercules-719a3c6f819cdd752d1719d8ed1cf21e47d8bbc5.tar.gz hercules-719a3c6f819cdd752d1719d8ed1cf21e47d8bbc5.tar.bz2 hercules-719a3c6f819cdd752d1719d8ed1cf21e47d8bbc5.tar.xz hercules-719a3c6f819cdd752d1719d8ed1cf21e47d8bbc5.zip |
Moved the 'changed' mailbox flag from shared mmo.h to mapserver-only.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13433 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/intif.c')
-rw-r--r-- | src/map/intif.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/map/intif.c b/src/map/intif.c index 6ad29368e..7130f2820 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -1438,6 +1438,7 @@ int intif_parse_Mail_inboxreceived(int fd) //FIXME: this operation is not safe [ultramage] memcpy(&sd->mail.inbox, RFIFOP(fd,9), sizeof(struct mail_data)); + sd->mail.changed = false; // cache is now in sync if (flag) clif_Mail_refreshinbox(sd); @@ -1634,7 +1635,9 @@ static void intif_parse_Mail_send(int fd) memcpy(&msg, RFIFOP(fd,4), sizeof(struct mail_message)); fail = (msg.id == 0); - if( (sd = map_charid2sd(msg.send_id)) ) + // notify sender + sd = map_charid2sd(msg.send_id); + if( sd != NULL ) { if( fail ) mail_deliveryfail(sd, &msg); @@ -1649,9 +1652,11 @@ static void intif_parse_Mail_send(int fd) if( fail ) return; - if( (sd = map_charid2sd(msg.dest_id)) ) + // notify recipient (if online) + sd = map_charid2sd(msg.dest_id); + if( sd != NULL ) { - sd->mail.inbox.changed = true; + sd->mail.changed = true; clif_Mail_new(sd->fd, msg.id, msg.send_name, msg.title); } } @@ -1666,7 +1671,7 @@ static void intif_parse_Mail_new(int fd) if( sd == NULL ) return; - sd->mail.inbox.changed = true; + sd->mail.changed = true; clif_Mail_new(sd->fd, mail_id, sender_name, title); } |