From e67711acbe9d29a2feb9293fccc72cd15603ee76 Mon Sep 17 00:00:00 2001 From: ultramage Date: Fri, 2 May 2008 15:08:14 +0000 Subject: Replaced the very ineffective clif_foreachclient() with map_foreachpc() since they essentially do the same thing (bugreport:1174). Rewrote map_foreachpc() so that its callback function signature now uses a more natural 'sd' instead of a DBKey/void* pair. Rewrote atcommand_users() to use a single function, instead of depending on two helper functions and global objects. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12683 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/clif.c | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'src/map/clif.c') diff --git a/src/map/clif.c b/src/map/clif.c index 9e197a945..78277161f 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -160,29 +160,6 @@ uint16 clif_getport(void) return map_port; } -/*========================================== - * 全てのclientに対してfunc()実行 - *------------------------------------------*/ -int clif_foreachclient(int (*func)(struct map_session_data*, va_list),...) //recoded by sasuke, bug when player count gets higher [Kevin] -{ - int i; - va_list ap; - struct map_session_data *sd; - - va_start(ap,func); - - 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; - if ( sd && sd->state.active ) - func(sd, ap); - } - } - - va_end(ap); - return 0; -} - /*========================================== * clif_sendでAREA*指定時用 *------------------------------------------*/ @@ -6339,7 +6316,7 @@ int clif_guild_emblem(struct map_session_data *sd,struct guild *g) /// Sends update of the guild id/emblem id to everyone in the area. void clif_guild_emblem_area(struct block_list* bl) { - char buf[12]; + uint8 buf[12]; nullpo_retv(bl); @@ -7916,7 +7893,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd) #endif // Notify everyone that this char logged in [Skotlex]. - clif_foreachclient(clif_friendslist_toggle_sub, sd->status.account_id, sd->status.char_id, 1); + map_foreachpc(clif_friendslist_toggle_sub, sd->status.account_id, sd->status.char_id, 1); //Login Event npc_script_event(sd, NPCE_LOGIN); -- cgit v1.2.3-60-g2f50