summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-27 22:42:31 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-27 22:42:31 +0000
commitcb273c650975c5c4ee7bc709c176f47c89ad332c (patch)
tree6eddf00d4ff8e5425a241e534db96067818b4fe3 /src/map/unit.c
parent7fde5cda86f543434529e5e5a79152091ca90744 (diff)
downloadhercules-cb273c650975c5c4ee7bc709c176f47c89ad332c.tar.gz
hercules-cb273c650975c5c4ee7bc709c176f47c89ad332c.tar.bz2
hercules-cb273c650975c5c4ee7bc709c176f47c89ad332c.tar.xz
hercules-cb273c650975c5c4ee7bc709c176f47c89ad332c.zip
- Applied some changes in unit.c to make mobs pick chase paths as they should.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6330 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index 8373095f3..1ba8fd92f 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -57,7 +57,9 @@ int unit_walktoxy_sub(struct block_list *bl)
memcpy(&ud->walkpath,&wpd,sizeof(wpd));
- if (ud->target && ud->chaserange >0) {
+ if (ud->target && ud->chaserange>1) {
+ //Generally speaking, the walk path is already to an adjacent tile
+ //so we only need to shorten the path if the range is greater than 1.
int dir;
//Trim the last part of the path to account for range,
//but always move at least one cell when requested to move.
@@ -1150,15 +1152,6 @@ int unit_can_reach_bl(struct block_list *bl,struct block_list *tbl, int range, i
wpd.path_pos=0;
wpd.path_half=0;
-#ifndef CELL_NOSTACK
- //Skip direct path seeking when in nostacking mode.
- if(path_search_real(&wpd,bl->m,bl->x,bl->y,tbl->x,tbl->y,easy,CELL_CHKNOREACH)!=-1) {
- if (x) *x = tbl->x;
- if (y) *y = tbl->y;
- return 1;
- }
-#endif
-
// It judges whether it can adjoin or not.
dx=tbl->x - bl->x;
dy=tbl->y - bl->y;