diff options
author | LuzZza <LuzZza@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-21 17:46:27 +0000 |
---|---|---|
committer | LuzZza <LuzZza@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-03-21 17:46:27 +0000 |
commit | 8334acc1e4991b02a5f963a546aed211659522b1 (patch) | |
tree | dd551a5fb238d423c68d6e457e1c25b8cfffc180 /src/map/guild.c | |
parent | 6460ab9b943f664e4353b375174a14e682e2d2fd (diff) | |
download | hercules-8334acc1e4991b02a5f963a546aed211659522b1.tar.gz hercules-8334acc1e4991b02a5f963a546aed211659522b1.tar.bz2 hercules-8334acc1e4991b02a5f963a546aed211659522b1.tar.xz hercules-8334acc1e4991b02a5f963a546aed211659522b1.zip |
Fix on not showing guildmembers logins/logouts messages.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5695 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/guild.c')
-rw-r--r-- | src/map/guild.c | 93 |
1 files changed, 48 insertions, 45 deletions
diff --git a/src/map/guild.c b/src/map/guild.c index 9158c876d..f2be83844 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -865,61 +865,52 @@ int guild_member_leaved(int guild_id,int account_id,int char_id,int flag, return 0;
}
-// ギルドメンバのオンライン状態/Lv更新送信
int guild_send_memberinfoshort(struct map_session_data *sd,int online)
-{
+{ // cleaned up [LuzZza]
+
struct guild *g;
- int i;
nullpo_retr(0, sd);
-
- if(sd->status.guild_id<=0)
+
+ if(!(g = guild_search(sd->status.guild_id)))
return 0;
- g=guild_search(sd->status.guild_id);
- if(g==NULL)
+
+ //Moved to place before intif_guild_memberinfoshort because
+ //If it's not a member, needn't send it's info to intif. [LuzZza]
+ guild_check_member(g);
+
+ if(sd->status.guild_id <= 0)
return 0;
intif_guild_memberinfoshort(g->guild_id,
sd->status.account_id,sd->status.char_id,online,sd->status.base_level,sd->status.class_);
- if( !online ){ // ログアウトするならsdをクリアして終了
- i=guild_getindex(g,sd->status.account_id,sd->status.char_id);
- if(i>=0)
- g->member[i].sd=NULL;
- return 0;
- } else if (sd->fd) {
- //Send XY dot updates. [Skotlex]
- for(i=0; i < MAX_GUILD; i++) {
- if (!g->member[i].sd || g->member[i].sd == sd ||
- g->member[i].sd->bl.m != sd->bl.m)
- continue;
- clif_guild_xy_single(sd->fd, g->member[i].sd);
- }
- }
-
- if( sd->state.guild_sent!=0 ) // ギルド初期送信データは送信済み
+ if(sd->state.guild_sent)
return 0;
- // 競合確認
- guild_check_conflict(sd);
-
- // あるならギルド初期送信データ送信
- guild_check_member(g); // 所属を確認する
- if(sd->status.guild_id==g->guild_id){
+ guild_check_conflict(sd); // mystery check
+
+ if(sd->status.guild_id == g->guild_id){
+
clif_guild_belonginfo(sd,g);
clif_guild_notice(sd,g);
- sd->state.guild_sent=1;
- sd->guild_emblem_id=g->emblem_id;
+
+ sd->state.guild_sent = 1;
+ sd->guild_emblem_id = g->emblem_id;
}
+
return 0;
}
-// ギルドメンバのオンライン状態/Lv更新通知
+
int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int online,int lv,int class_)
-{
+{ // cleaned up [LuzZza]
+
int i,alv,c,idx=-1,om=0,oldonline=-1;
- struct guild *g=guild_search(guild_id);
- if(g==NULL)
+ struct guild *g = guild_search(guild_id);
+
+ if(g == NULL)
return 0;
+
for(i=0,alv=0,c=0,om=0;i<g->max_member;i++){
struct guild_member *m=&g->member[i];
if(m->account_id==account_id && m->char_id==char_id ){
@@ -936,6 +927,7 @@ int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int onlin if(m->online)
om++;
}
+
if(idx == -1 || c == 0) {
// ギルドのメンバー外なので追放扱いする
struct map_session_data *sd = map_id2sd(account_id);
@@ -948,22 +940,33 @@ int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int onlin ShowWarning("guild: not found member %d,%d on %d[%s]\n", account_id,char_id,guild_id,g->name);
return 0;
}
+
g->average_lv=alv/c;
g->connect_member=om;
- if(oldonline!=online) // オンライン状態が変わったので通知
- clif_guild_memberlogin_notice(g,idx,online);
-
- for(i=0;i<g->max_member;i++){ // sd再設定
+ for(i=0;i<g->max_member;i++) {
struct map_session_data *sd= map_id2sd(g->member[i].account_id);
- if (sd && sd->status.char_id == g->member[i].char_id &&
- sd->status.guild_id == g->guild_id &&
- !sd->state.waitingdisconnect)
- g->member[i].sd = sd;
- else sd = NULL;
+ g->member[i].sd = (sd && sd->status.char_id == g->member[i].char_id &&
+ sd->status.guild_id == g->guild_id && !sd->state.waitingdisconnect) ? sd : NULL;
}
+
+ if(oldonline!=online)
+ clif_guild_memberlogin_notice(g, idx, online);
+
+
+ if(!g->member[idx].sd)
+ return 0;
+
+ //Send XY dot updates. [Skotlex]
+ //Moved from guild_send_memberinfoshort [LuzZza]
+ for(i=0; i < MAX_GUILD; i++) {
+
+ if(!g->member[i].sd || i == idx ||
+ g->member[i].sd->bl.m != g->member[idx].sd->bl.m)
+ continue;
- // ここにクライアントに送信処理が必要
+ clif_guild_xy_single(g->member[idx].sd->fd, g->member[i].sd);
+ }
return 0;
}
|