Browse Source

- Allowed disguising while riding a peco-peco (this does not seem to cause problems anymore)
- Adjusted pc_disguise to work properly if invoked while a player is not in a map.
- The pvp rank packet is no longer sent to other players when disguised, as this leads to crashes when you die.


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

skotlex 17 years ago
parent
commit
47315d00c8
3 changed files with 20 additions and 13 deletions
  1. 4 0
      Changelog-Trunk.txt
  2. 2 3
      src/map/clif.c
  3. 14 10
      src/map/pc.c

+ 4 - 0
Changelog-Trunk.txt

@@ -4,6 +4,10 @@ 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.
 
 2007/11/29
+	* Allowed disguising while riding a peco-peco (this does not seem to cause
+	  problems anymore).
+	* The pvp rank packet is no longer sent to other players when disguised, as
+	  this leads to crashes when you die.
 	* Probably fixed splash damage.
 	* Reflected spells no longer cause knockback. 
 	* SG Blessing skills now grant the extra experience to everyone when the SG

+ 2 - 3
src/map/clif.c

@@ -4718,9 +4718,8 @@ int clif_set0199(int fd,int type)
  *------------------------------------------*/
 int clif_pvpset(struct map_session_data *sd,int pvprank,int pvpnum,int type)
 {
-	int fd = sd->fd;
-
 	if(type == 2) {
+		int fd = sd->fd;
 		WFIFOHEAD(fd,packet_len(0x19a));
 		WFIFOW(fd,0) = 0x19a;
 		WFIFOL(fd,2) = sd->bl.id;
@@ -4736,7 +4735,7 @@ int clif_pvpset(struct map_session_data *sd,int pvprank,int pvpnum,int type)
 		else
 			WBUFL(buf,6) = pvprank;
 		WBUFL(buf,10) = pvpnum;
-		if(sd->sc.option&OPTION_INVISIBLE)
+		if(sd->sc.option&OPTION_INVISIBLE || sd->disguise) //Causes crashes when a 'mob' with pvp info dies.
 			clif_send(buf,packet_len(0x19a),&sd->bl,SELF);
 		else if(!type)
 			clif_send(buf,packet_len(0x19a),&sd->bl,AREA);

+ 14 - 10
src/map/pc.c

@@ -1209,7 +1209,7 @@ int pc_disguise(struct map_session_data *sd, int class_)
 {
 	if (!class_ && !sd->disguise)
 		return 0;
-	if (class_ && (sd->disguise == class_ || pc_isriding(sd)))
+	if (class_ && sd->disguise == class_)
 		return 0;
 
 	if(sd->sc.option&OPTION_INVISIBLE)
@@ -1217,9 +1217,11 @@ int pc_disguise(struct map_session_data *sd, int class_)
 		sd->disguise = class_; //viewdata is set on uncloaking.
 		return 2;
 	}
-	
-	pc_stop_walking(sd, 0);
-	clif_clearunit_area(&sd->bl, 0);
+
+	if (sd->bl.prev != NULL) {
+		pc_stop_walking(sd, 0);
+		clif_clearunit_area(&sd->bl, 0);
+	}
 
 	if (!class_) {
 		sd->disguise = 0;
@@ -1229,13 +1231,15 @@ int pc_disguise(struct map_session_data *sd, int class_)
 
 	status_set_viewdata(&sd->bl, class_);
 	clif_changeoption(&sd->bl);
-	clif_spawn(&sd->bl);
-	if (class_ == sd->status.class_ && pc_iscarton(sd))
-	{	//It seems the cart info is lost on undisguise.
-		clif_cartlist(sd);
-		clif_updatestatus(sd,SP_CARTINFO);
-	}
 
+	if (sd->bl.prev != NULL) {
+		clif_spawn(&sd->bl);
+		if (class_ == sd->status.class_ && pc_iscarton(sd))
+		{	//It seems the cart info is lost on undisguise.
+			clif_cartlist(sd);
+			clif_updatestatus(sd,SP_CARTINFO);
+		}
+	}
 	return 1;
 }