Browse Source

- Cleaned clif_pvpset to not send the packet to nearby characters when the source is GM-hidden. May help fix the crash on PvP with gm-hidden characters.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@7053 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 19 years ago
parent
commit
9ce708d5fc
3 changed files with 11 additions and 14 deletions
  1. 4 1
      Changelog-Trunk.txt
  2. 5 9
      src/map/clif.c
  3. 2 4
      src/map/pc.c

+ 4 - 1
Changelog-Trunk.txt

@@ -4,9 +4,12 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK.  ALL UNTESTED BUGFIXES/FEATURES GO
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
 
 
 2006/06/08
 2006/06/08
+	* Cleaned clif_pvpset to not send the packet to nearby characters when the
+	  source is GM-hidden. May help fix the crash on PvP with gm-hidden
+	  characters. [Skotlex]
 	* Modified map_freeblock_unlock so that aFree errors will report the
 	* Modified map_freeblock_unlock so that aFree errors will report the
 	  file/line that INVOKED the function rather than the function itself.
 	  file/line that INVOKED the function rather than the function itself.
-	  [Skotlex[
+	  [Skotlex]
 	  NOTE: Do NOT disable the memory manager as that will break this change.
 	  NOTE: Do NOT disable the memory manager as that will break this change.
 	  This change is to be temporarily set until the afree'd error can be
 	  This change is to be temporarily set until the afree'd error can be
 	  resolved.
 	  resolved.

+ 5 - 9
src/map/clif.c

@@ -5121,25 +5121,21 @@ int clif_pvpset(struct map_session_data *sd,int pvprank,int pvpnum,int type)
 		WFIFOHEAD(sd->fd,packet_len_table[0x19a]);
 		WFIFOHEAD(sd->fd,packet_len_table[0x19a]);
 		WFIFOW(sd->fd,0) = 0x19a;
 		WFIFOW(sd->fd,0) = 0x19a;
 		WFIFOL(sd->fd,2) = sd->bl.id;
 		WFIFOL(sd->fd,2) = sd->bl.id;
-		if(pvprank<=0)
-			pc_calc_pvprank(sd);
 		WFIFOL(sd->fd,6) = pvprank;
 		WFIFOL(sd->fd,6) = pvprank;
 		WFIFOL(sd->fd,10) = pvpnum;
 		WFIFOL(sd->fd,10) = pvpnum;
 		WFIFOSET(sd->fd,packet_len_table[0x19a]);
 		WFIFOSET(sd->fd,packet_len_table[0x19a]);
 	} else {
 	} else {
 		unsigned char buf[32];
 		unsigned char buf[32];
-
 		WBUFW(buf,0) = 0x19a;
 		WBUFW(buf,0) = 0x19a;
 		WBUFL(buf,2) = sd->bl.id;
 		WBUFL(buf,2) = sd->bl.id;
-		if(sd->sc.option&0x46)
-		// WTF? a -1 to an unsigned value...
-			WBUFL(buf,6) = 0xFFFFFFFF;
+		if(sd->sc.option&(OPTION_HIDE|OPTION_CLOAK))
+			WBUFL(buf,6) = ULONG_MAX; //On client displays as --
 		else
 		else
-			if(pvprank<=0)
-				pc_calc_pvprank(sd);
 			WBUFL(buf,6) = pvprank;
 			WBUFL(buf,6) = pvprank;
 		WBUFL(buf,10) = pvpnum;
 		WBUFL(buf,10) = pvpnum;
-		if(!type)
+		if(sd->sc.option&OPTION_INVISIBLE)
+			clif_send(buf,packet_len_table[0x19a],&sd->bl,SELF);
+		else if(!type)
 			clif_send(buf,packet_len_table[0x19a],&sd->bl,AREA);
 			clif_send(buf,packet_len_table[0x19a],&sd->bl,AREA);
 		else
 		else
 			clif_send(buf,packet_len_table[0x19a],&sd->bl,ALL_SAMEMAP);
 			clif_send(buf,packet_len_table[0x19a],&sd->bl,ALL_SAMEMAP);

+ 2 - 4
src/map/pc.c

@@ -6398,10 +6398,8 @@ int pc_calc_pvprank_sub(struct block_list *bl,va_list ap)
 {
 {
 	struct map_session_data *sd1,*sd2=NULL;
 	struct map_session_data *sd1,*sd2=NULL;
 
 
-	nullpo_retr(0, bl);
-	nullpo_retr(0, ap);
-	nullpo_retr(0, sd1=(struct map_session_data *)bl);
-	nullpo_retr(0, sd2=va_arg(ap,struct map_session_data *));
+	sd1=(struct map_session_data *)bl;
+	sd2=va_arg(ap,struct map_session_data *);
 
 
 	if( sd1->pvp_point > sd2->pvp_point )
 	if( sd1->pvp_point > sd2->pvp_point )
 		sd2->pvp_rank++;
 		sd2->pvp_rank++;