Bläddra i källkod

Fixed some issue with clif_loadConfirm (#5204)

Fixes #5203
Fixes #5278
Fixes #5376

Thanks to @aleos89 for his help and everyone else involved in reporting, commenting and testing.
Lemongrass3110 2 år sedan
förälder
incheckning
96e3981c68
6 ändrade filer med 36 tillägg och 24 borttagningar
  1. 8 7
      src/map/clan.cpp
  2. 23 8
      src/map/clif.cpp
  3. 1 0
      src/map/clif.hpp
  4. 1 3
      src/map/guild.cpp
  5. 0 3
      src/map/party.cpp
  6. 3 3
      src/map/pc.cpp

+ 8 - 7
src/map/clan.cpp

@@ -111,12 +111,16 @@ int clan_getNextFreeMemberIndex( struct clan* clan ){
 }
 
 void clan_member_joined( struct map_session_data* sd ){
-	struct clan* clan;
-	int index;
-
 	nullpo_retv(sd);
 
-	clan = clan_search(sd->status.clan_id);
+	if( sd->clan != nullptr ){
+		clif_clan_basicinfo( sd );
+		clif_clan_onlinecount( sd->clan );
+		return;
+	}
+
+	struct clan* clan = clan_search(sd->status.clan_id);
+	int index;
 
 	nullpo_retv(clan);
 
@@ -129,9 +133,6 @@ void clan_member_joined( struct map_session_data* sd ){
 
 		intif_clan_member_joined(clan->id);
 		clif_clan_onlinecount(clan);
-
-		if (clan->instance_id > 0)
-			instance_reqinfo(sd, clan->instance_id);
 	}
 }
 

+ 23 - 8
src/map/clif.cpp

@@ -18761,6 +18761,28 @@ void clif_parse_MemorialDungeonCommand(int fd, map_session_data *sd)
 	}
 }
 
+void clif_instance_info( struct map_session_data& sd ){
+	if( sd.instance_id > 0 ){
+		instance_reqinfo( &sd, sd.instance_id );
+	}
+
+	if( sd.status.party_id > 0 ){
+		struct party_data* p = party_search( sd.status.party_id );
+
+		if( p != nullptr && p->instance_id > 0 ){
+			instance_reqinfo( &sd, p->instance_id );
+		}
+	}
+
+	if( sd.guild != nullptr && sd.guild->instance_id > 0 ){
+		instance_reqinfo( &sd, sd.guild->instance_id );
+	}
+
+	if( sd.clan != nullptr && sd.clan->instance_id > 0 ){
+		instance_reqinfo( &sd, sd.clan->instance_id );
+	}
+}
+
 /// Notifies clients about item picked up by a party member.
 /// 02b8 <account id>.L <name id>.W <identified>.B <damaged>.B <refine>.B <card1>.W <card2>.W <card3>.W <card4>.W <equip location>.W <item type>.B (ZC_ITEM_PICKUP_PARTY)
 void clif_party_show_picker( struct map_session_data* sd, struct item* item_data ){
@@ -19817,14 +19839,7 @@ static void clif_loadConfirm( struct map_session_data *sd ){
 
 	clif_send( &p, sizeof(p), &sd->bl, SELF );
 
-	if (sd->instance_id > 0)
-		instance_reqinfo(sd, sd->instance_id);
-	if (sd->status.party_id > 0)
-		party_member_joined(sd);
-	if (sd->status.guild_id > 0)
-		guild_member_joined(sd);
-	if (sd->status.clan_id > 0)
-		clan_member_joined(sd);
+	clif_instance_info( *sd );
 #endif
 }
 

+ 1 - 0
src/map/clif.hpp

@@ -881,6 +881,7 @@ void clif_instance_changewait(int instance_id, int num);
 void clif_instance_status(int instance_id, unsigned int limit1, unsigned int limit2);
 void clif_instance_changestatus(int instance_id, e_instance_notify type, unsigned int limit);
 void clif_parse_MemorialDungeonCommand(int fd, map_session_data *sd);
+void clif_instance_info( struct map_session_data& sd );
 
 // Custom Fonts
 void clif_font(struct map_session_data *sd);

+ 1 - 3
src/map/guild.cpp

@@ -844,7 +844,7 @@ void guild_member_joined(struct map_session_data *sd) {
 		sd->state.gmaster_flag = 1;
 #ifndef RENEWAL
 		// prevent Guild Skills from being used directly after relog
-		if( battle_config.guild_skill_relog_delay )
+		if( sd->state.connect_new == 1 && battle_config.guild_skill_relog_delay )
 			guild_block_skill(sd, battle_config.guild_skill_relog_delay);
 #endif
 	}
@@ -855,8 +855,6 @@ void guild_member_joined(struct map_session_data *sd) {
 		g->member[i].sd = sd;
 		sd->guild = g;
 
-		if (g->instance_id > 0)
-			instance_reqinfo(sd, g->instance_id);
 		if( channel_config.ally_tmpl.name[0] && (channel_config.ally_tmpl.opt&CHAN_OPT_AUTOJOIN) ) {
 			channel_gjoin(sd,3);
 		}

+ 0 - 3
src/map/party.cpp

@@ -506,9 +506,6 @@ void party_member_joined(struct map_session_data *sd)
 
 	if (i < MAX_PARTY) {
 		p->data[i].sd = sd;
-
-		if (p->instance_id > 0)
-			instance_reqinfo(sd, p->instance_id);
 	} else
 		sd->status.party_id = 0; //He does not belongs to the party really?
 }

+ 3 - 3
src/map/pc.cpp

@@ -2063,15 +2063,15 @@ void pc_reg_received(struct map_session_data *sd)
 		}
 	}
 
-#if PACKETVER_MAIN_NUM < 20190403 || PACKETVER_RE_NUM < 20190320 || PACKETVER_ZERO_NUM < 20190410
-	if (sd->instance_id > 0)
-		instance_reqinfo(sd, sd->instance_id);
 	if (sd->status.party_id > 0)
 		party_member_joined(sd);
 	if (sd->status.guild_id > 0)
 		guild_member_joined(sd);
 	if (sd->status.clan_id > 0)
 		clan_member_joined(sd);
+#if !( PACKETVER_MAIN_NUM >= 20190403 || PACKETVER_RE_NUM >= 20190320 || PACKETVER_ZERO_NUM >= 20190410 )
+	// Before those clients you could send out the instance info even when the client was still loading the map, afterwards you need to send it later
+	clif_instance_info( *sd );
 #endif
 
 	// pet