From 0594ed80d95621d3e6af7d150e7c56fc2b0bc6ca Mon Sep 17 00:00:00 2001 From: skotlex Date: Mon, 17 Sep 2007 20:15:36 +0000 Subject: - Finally got some time to clean up and fix monster_ai&0x40 (chase through warps). It works correctly now regardless of the number of players on the source/destination maps. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11233 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/unit.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/map/unit.c') diff --git a/src/map/unit.c b/src/map/unit.c index b92804459..3befc3f2d 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -233,6 +233,8 @@ static int unit_walktoxy_timer(int tid,unsigned int tick,int id,int data) if (!tbl || !status_check_visibility(bl, tbl)) { //Cancel chase. ud->to_x = bl->x; ud->to_y = bl->y; + if (tbl && bl->type == BL_MOB) //See if the mob can do a warp chase. + mob_warpchase((TBL_MOB*)bl, tbl); return 0; } if (tbl->m == bl->m && check_distance_bl(bl, tbl, ud->chaserange)) @@ -1367,9 +1369,16 @@ static int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int t if(src == NULL || src->prev == NULL || target==NULL || target->prev == NULL) return 0; - if(src->m != target->m || status_isdead(src) || status_isdead(target) || !status_check_skilluse(src, target, 0, 0)) + if(status_isdead(src) || status_isdead(target) || !status_check_skilluse(src, target, 0, 0)) return 0; // can't attack under these conditions + if (src->m != target->m) + { + if (src->type == BL_MOB && mob_warpchase((TBL_MOB*)src, target)) + return 1; // Follow up. + return 0; + } + if(ud->skilltimer != -1 && !(sd && pc_checkskill(sd,SA_FREECAST) > 0)) return 0; // can't attack while casting -- cgit v1.2.3-60-g2f50