Ver Fonte

- Fixed slaves warping endlessly to their master when the master-slave distance exceeds 30.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@6909 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex há 19 anos atrás
pai
commit
ff4b163da3
2 ficheiros alterados com 5 adições e 1 exclusões
  1. 2 0
      Changelog-Trunk.txt
  2. 3 1
      src/map/mob.c

+ 2 - 0
Changelog-Trunk.txt

@@ -4,6 +4,8 @@ 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.
 
 2006/06/01
+	* Fixed slaves warping endlessly to their master when the master-slave
+	  distance exceeds 30. [Skotlex]
 	* SC_ORCISH will now be dispelled on logout (if debufF_on_logout is set)
 	  [Skotlex]
 	* Removed attackrange/attackrange_ from TBL_PC, corrected clif.c using the

+ 3 - 1
src/map/mob.c

@@ -893,6 +893,7 @@ static int mob_ai_sub_hard_slavemob(struct mob_data *md,unsigned int tick)
 		if(bl->m != md->bl.m || md->master_dist > 30)
 		{	// Since it is not in the same map (or is way to far), just warp it
 			unit_warp(&md->bl,bl->m,bl->x,bl->y,3);
+			md->master_dist = 0;
 			return 0;
 		}
 
@@ -903,11 +904,12 @@ static int mob_ai_sub_hard_slavemob(struct mob_data *md,unsigned int tick)
 		// Since the master was in near immediately before, teleport is carried out and it pursues.
 		if(old_dist<10 && md->master_dist>18){
 			unit_warp(&md->bl,-1,bl->x,bl->y,3);
+			md->master_dist = 0;
 			return 0;
 		}
 
 		// Approach master if within view range, chase back to Master's area also if standing on top of the master.
-		if(md->master_dist<md->db->range3 &&
+		if(md->master_dist<AREA_SIZE &&
 			(md->master_dist>MOB_SLAVEDISTANCE || md->master_dist == 0) &&
 			unit_can_move(&md->bl))
 		{