summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-11 20:34:05 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-07-11 20:34:05 +0000
commit9c48b73d948502c2784e43640401a2344de40a7f (patch)
treeee3b85381a84564ae876f72250995b02fd9d9396
parentf5ee813da23e1a27a545086be3592803710a37f4 (diff)
downloadhercules-9c48b73d948502c2784e43640401a2344de40a7f.tar.gz
hercules-9c48b73d948502c2784e43640401a2344de40a7f.tar.bz2
hercules-9c48b73d948502c2784e43640401a2344de40a7f.tar.xz
hercules-9c48b73d948502c2784e43640401a2344de40a7f.zip
- Fixed map-sql compilation issue ~.~;
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7619 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--src/map/mail.c29
1 files changed, 12 insertions, 17 deletions
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);