From 7626b141f8e56b1739abce76f5a99cbbb2b4b159 Mon Sep 17 00:00:00 2001 From: malufett Date: Sun, 3 Feb 2013 23:21:36 +0800 Subject: Fixed Bug #7042 Fixed wrong 'if' condition in checking CELL_CHKNOPASS for the OFFICIAL_WALKPATH where clear path is considered to be limited to 14 cells it should only be with obstacles. --- src/map/unit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/map/unit.c') diff --git a/src/map/unit.c b/src/map/unit.c index b7da5629f..afb7cf19f 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -325,7 +325,8 @@ int unit_walktoxy( struct block_list *bl, short x, short y, int flag) if( ud == NULL) return 0; #ifdef OFFICIAL_WALKPATH - if( path_search(&wpd, bl->m, bl->x, bl->y, x, y, flag&1, CELL_CHKNOPASS) // Check if there is an obstacle between + path_search(&wpd, bl->m, bl->x, bl->y, x, y, flag&1, CELL_CHKNOPASS); // Count walk path cells + if( !path_search_long(NULL, bl->m, bl->x, bl->y, x, y, CELL_CHKNOPASS) // Check if there is an obstacle between && wpd.path_len > 14 ) // Official number of walkable cells is 14 if and only if there is an obstacle between. [malufett] return 0; #endif -- cgit v1.2.3-60-g2f50