Browse Source

Follow up to c683520 (#8737)

Fixes #8734
Toshiro90 6 months ago
parent
commit
d02f460595
2 changed files with 10 additions and 10 deletions
  1. 1 1
      src/map/clif.cpp
  2. 9 9
      src/map/guild.cpp

+ 1 - 1
src/map/clif.cpp

@@ -9029,7 +9029,7 @@ void clif_guild_emblem_area(struct block_list* bl)
 	p.emblem_id = status_get_emblem_id(bl);
 	p.AID = bl->id;
 
-	clif_send(&p, sizeof(p), bl, AREA_WOS);
+	clif_send(&p, sizeof(p), bl, AREA);
 }
 
 

+ 9 - 9
src/map/guild.cpp

@@ -844,9 +844,7 @@ int guild_recv_info(const struct mmo_guild &sg) {
 #endif
 
 			//Also set the guild master flag.
-			sd->guild = g;
 			sd->state.gmaster_flag = 1;
-			clif_name_area(&sd->bl); // [LuzZza]
 			clif_guild_masterormember(*sd);
 		}
 	} else {
@@ -873,11 +871,9 @@ int guild_recv_info(const struct mmo_guild &sg) {
 		sd = g->guild.member[i].sd;
 		if( sd==nullptr )
 			continue;
-		if( sd->guild == nullptr ){
+		if( sd->guild == nullptr || sd->guild != g ){
 			sd->guild = g;
 			clif_name_area(&sd->bl);
-		}else{
-			sd->guild = g;
 		}
 		if(channel_config.ally_tmpl.name[0] && (channel_config.ally_tmpl.opt&CHAN_OPT_AUTOJOIN)) {
 			channel_gjoin(sd,3); //make all member join guildchan+allieschan
@@ -1095,6 +1091,7 @@ void guild_member_joined(map_session_data *sd) {
 	else {
 		g->guild.member[i].sd = sd;
 		sd->guild = g;
+		clif_name_area(&sd->bl);
 
 		if( channel_config.ally_tmpl.name[0] && (channel_config.ally_tmpl.opt&CHAN_OPT_AUTOJOIN) ) {
 			channel_gjoin(sd,3);
@@ -1138,13 +1135,14 @@ int guild_member_added(int guild_id,uint32 account_id,uint32 char_id,int flag) {
 	clif_guild_belonginfo( *sd );
 	clif_guild_notice( *sd );
 
-	//TODO: send new emblem info to others
+	// Send emblem update to self and people around
+	clif_guild_emblem_area(&sd->bl);
 
 	if( sd2!=nullptr )
 		clif_guild_inviteack( *sd2, 2 );
 
-	//Next line commented because it do nothing, look at guild_recv_info [LuzZza]
-	//clif_charnameupdate(sd); //Update display name [Skotlex]
+	// Update display name
+	clif_name_area(&sd->bl);
 
 	if (g->instance_id > 0)
 		instance_reqinfo(sd, g->instance_id);
@@ -1306,7 +1304,9 @@ int guild_member_withdraw(int guild_id, uint32 account_id, uint32 char_id, int f
 		status_change_end(&sd->bl,SC_SOULCOLD);
 		status_change_end(&sd->bl,SC_HAWKEYES);
 		status_change_end(&sd->bl,SC_EMERGENCY_MOVE);
-		//@TODO: Send emblem update to self and people around
+
+		// Send emblem update to self and people around
+		clif_guild_emblem_area(&sd->bl);
 	}
 	return 0;
 }