summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index d4d0fd45d..cae0eddf3 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -815,8 +815,12 @@ static int mob_walktoxy_sub(struct mob_data *md)
nullpo_retr(0, md);
+ memset(&wpd, 0, sizeof(wpd));
+
if(path_search(&wpd,md->bl.m,md->bl.x,md->bl.y,md->to_x,md->to_y,md->state.walk_easy))
return 1;
+ if (wpd.path[0] >= 8)
+ return 1;
x = md->bl.x+dirx[wpd.path[0]];
y = md->bl.y+diry[wpd.path[0]];
if (map_getcell(md->bl.m,x,y,CELL_CHKBASILICA) && !(status_get_mode(&md->bl)&0x20)) {