From 9c48b73d948502c2784e43640401a2344de40a7f Mon Sep 17 00:00:00 2001 From: skotlex Date: Tue, 11 Jul 2006 20:34:05 +0000 Subject: - Fixed map-sql compilation issue ~.~; git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7619 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/mail.c | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'src/map/mail.c') diff --git a/src/map/mail.c b/src/map/mail.c index 1f25861c1..353ddd2d6 100644 --- a/src/map/mail.c +++ b/src/map/mail.c @@ -302,11 +302,18 @@ int mail_send(struct map_session_data *sd, char *name, char *message, int flag) return 0; } -int mail_check_timer(int tid,unsigned int tick,int id,int data) +static int mail_check_timer_sub(struct map_session_data *sd, va_list va) { - struct map_session_data *sd = NULL; - int i; + int id = va_arg(va, int); + if(pc_isGM(sd) < 80 && sd->mail_counter > 0) + sd->mail_counter--; + if(sd->status.account_id==id) + clif_displaymessage(sd->fd, msg_txt(526)); //you got new email. + return 0; +} +int mail_check_timer(int tid,unsigned int tick,int id,int data) +{ if(mail_timer != tid) return 0; @@ -328,20 +335,8 @@ int mail_check_timer(int tid,unsigned int tick,int id,int data) return 0; } - while ((mail_row = mysql_fetch_row(mail_res))) { - for (i = 0; i < fd_max; i++) { - if (session[i] && session[i]->func_parse == clif_parse && - (sd = (struct map_session_data *) session[i]->session_data) && - sd->state.auth) - { - if(pc_isGM(sd) < 80 && sd->mail_counter > 0) - sd->mail_counter--; - if(sd->status.account_id==atoi(mail_row[0])) - //clif_displaymessage(sd->fd, "You have new mail."); - clif_displaymessage(sd->fd, msg_txt(526)); - } - } - } + while ((mail_row = mysql_fetch_row(mail_res))) + clif_foreachclient(mail_check_timer_sub, atoi(mail_row[0])); } sprintf(tmp_sql,"UPDATE `%s` SET `check_flag`='1' WHERE `check_flag`= '0' ", mail_db); -- cgit v1.2.3-70-g09d2