summaryrefslogtreecommitdiff
path: root/src/map/guild.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/guild.c')
-rw-r--r--src/map/guild.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/src/map/guild.c b/src/map/guild.c
index ea9c3795f..06838c4b8 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -678,11 +678,10 @@ int guild_member_leaved(int guild_id,int account_id,int char_id,int flag,
{
struct map_session_data *sd=map_id2sd(account_id);
struct guild *g=guild_search(guild_id);
- int i;
if(g!=NULL){
int i;
- for(i=0;i<g->max_member;i++)
+ for(i=0;i<g->max_member;i++) {
if( g->member[i].account_id==account_id &&
g->member[i].char_id==char_id ){
struct map_session_data *sd2=sd;
@@ -698,6 +697,12 @@ int guild_member_leaved(int guild_id,int account_id,int char_id,int flag,
g->member[i].account_id=0;
g->member[i].sd=NULL;
}
+ // メンバーリストを全員に再通知
+ for(i=0;i<g->max_member;i++){
+ if( g->member[i].sd!=NULL )
+ clif_guild_memberlist(g->member[i].sd);
+ }
+ }
}
if(sd!=NULL) {
if (sd->status.guild_id==guild_id){
@@ -706,13 +711,7 @@ int guild_member_leaved(int guild_id,int account_id,int char_id,int flag,
sd->guild_sended=0;
}
}
-
- // メンバーリストを全員に再通知
- for(i=0;i<g->max_member;i++){
- if( g->member[i].sd!=NULL )
- clif_guild_memberlist(g->member[i].sd);
- }
-
+
return 0;
}
// ギルドメンバのオンライン状態/Lv更新送信
@@ -1037,6 +1036,23 @@ int guild_get_alliance_count(struct guild *g,int flag)
}
return c;
}
+// 同盟関係かどうかチェック
+// 同盟なら1、それ以外は0
+int guild_check_alliance(int guild_id1, int guild_id2, int flag)
+{
+ struct guild *g;
+ int i;
+
+ g = guild_search(guild_id1);
+ if (g == NULL)
+ return 0;
+
+ for (i=0; i<MAX_GUILDALLIANCE; i++)
+ if ((g->alliance[i].guild_id == guild_id2) && (g->alliance[i].opposition == flag))
+ return 1;
+
+ return 0;
+}
// ギルド同盟要求
int guild_reqalliance(struct map_session_data *sd,int account_id)
{