Explorar el Código

- Fixed guild emblem not showing when you log in (caused by r5359)
- Fixed server not sending party/guild info when you enter a map
- Fixed server not removing member minimap dot when you leave a guild

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@10624 54d463be-8e91-2dee-dedb-b68131a5f0ec

ultramage hace 18 años
padre
commit
ae259970a8
Se han modificado 4 ficheros con 68 adiciones y 53 borrados
  1. 5 0
      Changelog-Trunk.txt
  2. 9 9
      src/map/clif.c
  3. 48 42
      src/map/guild.c
  4. 6 2
      src/map/party.c

+ 5 - 0
Changelog-Trunk.txt

@@ -3,6 +3,11 @@ Date	Added
 AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
+2007/05/26
+	* Identified several more glitches, too tired to fix these...
+	* Fixed server not removing member minimap dot when you leave a guild
+	* Fixed server not sending party/guild info when you enter a map
+	* Fixed guild emblem not showing when you log in (caused by r5359)
 2007/05/25
 	* Fixed @statall giving you +99 stats instead of setting them to 99
 	* Fixed npctalk and @npctalk displaying the # part of the name

+ 9 - 9
src/map/clif.c

@@ -8012,15 +8012,6 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
 	clif_updatestatus(sd,SP_MAXWEIGHT);
 	clif_updatestatus(sd,SP_WEIGHT);
 
-	if(battle_config.pc_invincible_time > 0) {
-		if(map_flag_gvg(sd->bl.m))
-			pc_setinvincibletimer(sd,battle_config.pc_invincible_time<<1);
-		else
-			pc_setinvincibletimer(sd,battle_config.pc_invincible_time);
-	}
-	map_addblock(&sd->bl);	// ブロック登録
-	clif_spawn(&sd->bl);	// spawn
-
 	// Party
 	if(sd->status.party_id) {
 		party_send_movemap(sd);
@@ -8031,6 +8022,15 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
 	if(sd->status.guild_id)
 		guild_send_memberinfoshort(sd,1);
 
+	if(battle_config.pc_invincible_time > 0) {
+		if(map_flag_gvg(sd->bl.m))
+			pc_setinvincibletimer(sd,battle_config.pc_invincible_time<<1);
+		else
+			pc_setinvincibletimer(sd,battle_config.pc_invincible_time);
+	}
+	map_addblock(&sd->bl);	// ブロック登録
+	clif_spawn(&sd->bl);	// spawn
+
 	if(map[sd->bl.m].flag.pvp) {
 		if(!battle_config.pk_mode) { // remove pvp stuff for pk_mode [Valaris]
 			if (!map[sd->bl.m].flag.pvp_nocalcrank)

+ 48 - 42
src/map/guild.c

@@ -715,10 +715,10 @@ int guild_reply_invite(struct map_session_data *sd,int guild_id,int flag)
 			return 0;
 		}
 
-
 		//inter鯖へ追加要求
 		guild_makemember(&m,sd);
 		intif_guild_addmember( sd->guild_invite, &m );
+		//TODO: send a minimap update to this player
 		return 0;
 	}else{		// 拒否
 		sd->guild_invite=0;
@@ -756,8 +756,10 @@ int guild_member_added(int guild_id,int account_id,int char_id,int flag)
 	}
 
 		// 成功
-	sd->state.guild_sent=0;
-	sd->status.guild_id=guild_id;
+	sd->state.guild_sent = 0;
+	sd->status.guild_id = g->guild_id;
+	sd->guild_emblem_id = g->emblem_id;
+	//TODO: send new emblem info to others
 
 	if( sd2!=NULL )
 		clif_guild_inviteack(sd2,2);
@@ -770,8 +772,7 @@ int guild_member_added(int guild_id,int account_id,int char_id,int flag)
 }
 
 // ギルド脱退要求
-int guild_leave(struct map_session_data *sd,int guild_id,
-	int account_id,int char_id,const char *mes)
+int guild_leave(struct map_session_data* sd, int guild_id, int account_id, int char_id, const char* mes)
 {
 	struct guild *g;
 
@@ -790,9 +791,9 @@ int guild_leave(struct map_session_data *sd,int guild_id,
 	intif_guild_leave(sd->status.guild_id, sd->status.account_id, sd->status.char_id,0,mes);
 	return 0;
 }
+
 // ギルド追放要求
-int guild_expulsion(struct map_session_data *sd,int guild_id,
-	int account_id,int char_id,const char *mes)
+int guild_expulsion(struct map_session_data* sd, int guild_id, int account_id, int char_id, const char* mes)
 {
 	struct map_session_data *tsd;
 	struct guild *g;
@@ -829,47 +830,51 @@ int guild_expulsion(struct map_session_data *sd,int guild_id,
 	return 0;
 }
 
-int guild_member_leaved(int guild_id,int account_id,int char_id,int flag,
-	const char *name,const char *mes) // rewrote [LuzZza]
+int guild_member_leaved(int guild_id, int account_id, int char_id, int flag, const char* name, const char* mes)
 {
 	int i;
-	struct guild *g = guild_search(guild_id);
-	struct map_session_data *sd = map_charid2sd(char_id);
-	struct map_session_data *online_member_sd;
+	struct guild* g = guild_search(guild_id);
+	struct map_session_data* sd = map_charid2sd(char_id);
+	struct map_session_data* online_member_sd;
 
 	if(g == NULL)
-		return 0;
+		return 0; // no such guild (error!)
 	
-	for(i=0;i<g->max_member;i++) {
-		if( g->member[i].account_id == account_id &&
-			g->member[i].char_id == char_id ){
-
-				if((online_member_sd = guild_getavailablesd(g)) == NULL)
-					return 0;
-
-				if(!flag)
-					clif_guild_leave(online_member_sd, name, mes);
-				else
-					clif_guild_expulsion(online_member_sd, name, mes, account_id);
-
-				memset(&g->member[i],0,sizeof(struct guild_member));
-				clif_guild_memberlist(online_member_sd);
-
-				if(sd != NULL && sd->status.guild_id == guild_id) {
-					if (sd->state.storage_flag == 2) //Close the guild storage.
-						storage_guild_storageclose(sd);
-					sd->status.guild_id=0;
-					sd->guild_emblem_id=0;
-					sd->state.guild_sent=0;
-					
-					guild_send_dot_remove(sd);
-					clif_charnameupdate(sd); //Update display name [Skotlex]
-				}
-				return 0;
-		}
-					
-	}
+	for(i = 0; i < g->max_member; i++)
+		if( g->member[i].account_id == account_id && g->member[i].char_id == char_id )
+			break;
+
+	if (i == g->max_member)
+		return 0; // not a member (inconsistency!)
+
+	online_member_sd = guild_getavailablesd(g);
+	if(online_member_sd == NULL)
+		return 0; // noone online to inform
+
+	if(!flag)
+		clif_guild_leave(online_member_sd, name, mes);
+	else
+		clif_guild_expulsion(online_member_sd, name, mes, account_id);
+
+	// remove member from guild
+	memset(&g->member[i],0,sizeof(struct guild_member));
+	clif_guild_memberlist(online_member_sd);
 
+	// update char, if online
+	if(sd != NULL && sd->status.guild_id == guild_id)
+	{
+		// do stuff that needs the guild_id first, BEFORE we wipe it
+		if (sd->state.storage_flag == 2) //Close the guild storage.
+			storage_guild_storageclose(sd);
+		guild_send_dot_remove(sd);
+
+		sd->status.guild_id = 0;
+		sd->guild_emblem_id = 0;
+		sd->state.guild_sent = 0;
+		
+		clif_charnameupdate(sd); //Update display name [Skotlex]
+		//TODO: send emblem update to self and people around
+	}
 	return 0;
 }
 
@@ -975,6 +980,7 @@ int guild_recv_memberinfoshort(int guild_id,int account_id,int char_id,int onlin
 			continue;
 
 		clif_guild_xy_single(g->member[idx].sd->fd, g->member[i].sd);
+		clif_guild_xy_single(g->member[i].sd->fd, g->member[idx].sd);
 	}			
 
 	return 0;

+ 6 - 2
src/map/party.c

@@ -427,6 +427,7 @@ int party_member_leaved(int party_id,int account_id,int char_id)
 		sd->status.party_id=0;
 		sd->state.party_sent=0;
 		clif_charnameupdate(sd); //Update name display [Skotlex]
+		//TODO: hp bars should be cleared too
 	}
 	return 0;
 }
@@ -532,12 +533,15 @@ void party_send_movemap(struct map_session_data *sd)
 		}
 	}
 
-	if (sd->fd) { //Send dots of other party members to this char. [Skotlex]
+	if (sd->fd) { // synchronize minimap positions with the rest of the party
 		for(i=0; i < MAX_PARTY; i++) {
-			if (p->data[i].sd &&
+			if (p->data[i].sd && 
 				p->data[i].sd != sd &&
 				p->data[i].sd->bl.m == sd->bl.m)
+			{
 				clif_party_xy_single(sd->fd, p->data[i].sd);
+				clif_party_xy_single(p->data[i].sd->fd, sd);
+			}
 		}
 	}
 	return;