Sfoglia il codice sorgente

* Fixed battlegrounds chat packet 0x2dc (ZC_BATTLEFIELD_CHAT) being sent with the battleground id rather than the account id of the talking player (since r13593).

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14760 54d463be-8e91-2dee-dedb-b68131a5f0ec
ai4rei 14 anni fa
parent
commit
13d8ac9537
4 ha cambiato i file con 10 aggiunte e 5 eliminazioni
  1. 2 0
      Changelog-Trunk.txt
  2. 2 2
      src/map/battleground.c
  3. 5 2
      src/map/clif.c
  4. 1 1
      src/map/clif.h

+ 2 - 0
Changelog-Trunk.txt

@@ -1,5 +1,7 @@
 Date	Added
 
+2011/03/25
+	* Fixed battlegrounds chat packet 0x2dc (ZC_BATTLEFIELD_CHAT) being sent with the battleground id rather than the account id of the talking player (since r13593). [Ai4rei]
 2011/03/22
 	* Documentation updates and fixes. [Ai4rei]
 	- Added documentation for script commands 'bg_getareausers' and 'bg_get_data' (bugreport:3034).

+ 2 - 2
src/map/battleground.c

@@ -130,7 +130,7 @@ int bg_team_leave(struct map_session_data *sd, int flag)
 		sprintf(output, "Server : %s has quit the game...", sd->status.name);
 	else
 		sprintf(output, "Server : %s is leaving the battlefield...", sd->status.name);
-	clif_bg_message(bg, "Server", output, strlen(output) + 1);
+	clif_bg_message(bg, 0, "Server", output, strlen(output) + 1);
 
 	if( bg->logout_event[0] && flag )
 		npc_event(sd, bg->logout_event, 0);
@@ -212,7 +212,7 @@ int bg_send_message(struct map_session_data *sd, const char *mes, int len)
 	nullpo_ret(sd);
 	if( sd->state.bg_id == 0 || (bg = bg_team_search(sd->state.bg_id)) == NULL )
 		return 0;
-	clif_bg_message(bg, sd->status.name, mes, len);
+	clif_bg_message(bg, sd->bl.id, sd->status.name, mes, len);
 	return 0;
 }
 

+ 5 - 2
src/map/clif.c

@@ -13759,7 +13759,10 @@ int clif_bg_xy_remove(struct map_session_data *sd)
 	return 0;
 }
 
-int clif_bg_message(struct battleground_data *bg, const char *name, const char *mes, int len)
+
+/// Notifies clients of a battleground message (ZC_BATTLEFIELD_CHAT)
+/// 02dc <packet len>.W <account id>.L <name>.24B <message>.?B
+int clif_bg_message(struct battleground_data *bg, int src_id, const char *name, const char *mes, int len)
 {
 	struct map_session_data *sd;
 	unsigned char *buf;
@@ -13770,7 +13773,7 @@ int clif_bg_message(struct battleground_data *bg, const char *name, const char *
 
 	WBUFW(buf,0) = 0x2dc;
 	WBUFW(buf,2) = len + NAME_LENGTH + 8;
-	WBUFL(buf,4) = sd->state.bg_id;
+	WBUFL(buf,4) = src_id;
 	memcpy(WBUFP(buf,8), name, NAME_LENGTH);
 	memcpy(WBUFP(buf,32), mes, len);
 	clif_send(buf,WBUFW(buf,2), &sd->bl, BG);

+ 1 - 1
src/map/clif.h

@@ -451,7 +451,7 @@ int clif_guild_xy_remove(struct map_session_data *sd);
 int clif_bg_hp(struct map_session_data *sd);
 int clif_bg_xy(struct map_session_data *sd);
 int clif_bg_xy_remove(struct map_session_data *sd);
-int clif_bg_message(struct battleground_data *bg, const char *name, const char *mes, int len);
+int clif_bg_message(struct battleground_data *bg, int src_id, const char *name, const char *mes, int len);
 int clif_bg_updatescore(int m);
 int clif_bg_updatescore_single(struct map_session_data *sd);
 int clif_sendbgemblem_area(struct map_session_data *sd);