diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-09-17 20:15:36 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2007-09-17 20:15:36 +0000 |
commit | 0594ed80d95621d3e6af7d150e7c56fc2b0bc6ca (patch) | |
tree | 488f022ac5a1bbdfd40f4755b3ed676b22b60962 /src/map/unit.c | |
parent | 064924d37b34eb38c5b602f6f816c2abd1b995b1 (diff) | |
download | hercules-0594ed80d95621d3e6af7d150e7c56fc2b0bc6ca.tar.gz hercules-0594ed80d95621d3e6af7d150e7c56fc2b0bc6ca.tar.bz2 hercules-0594ed80d95621d3e6af7d150e7c56fc2b0bc6ca.tar.xz hercules-0594ed80d95621d3e6af7d150e7c56fc2b0bc6ca.zip |
- 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
Diffstat (limited to 'src/map/unit.c')
-rw-r--r-- | src/map/unit.c | 11 |
1 files changed, 10 insertions, 1 deletions
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 |