summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-01 15:03:48 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-01 15:03:48 +0000
commitf2fb40769774277b5e14074f5251269124da2976 (patch)
treeea65fd22fd9aeb0632b2a9f16d4775f96f68c48c /src/map/mob.c
parent6bd986c4d7ffdfed5197e0a3ddd5f0a9f0324946 (diff)
downloadhercules-f2fb40769774277b5e14074f5251269124da2976.tar.gz
hercules-f2fb40769774277b5e14074f5251269124da2976.tar.bz2
hercules-f2fb40769774277b5e14074f5251269124da2976.tar.xz
hercules-f2fb40769774277b5e14074f5251269124da2976.zip
- Fixed slaves warping endlessly to their master when the master-slave distance exceeds 30.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6909 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 3991fb357..46d7f1c9d 100644
--- a/src/map/mob.c
+++ b/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))
{