summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authormalufett <malufett.eat.my.binaries@gmail.com>2013-02-05 19:12:39 +0800
committermalufett <malufett.eat.my.binaries@gmail.com>2013-02-05 19:13:18 +0800
commitc69e4b6cf853d31f18ef9c2f04d2bc965f4ad158 (patch)
tree7e881232e12e393e6b8ad26119221d35655b9e42 /src/map/unit.c
parentf9d5d4fccc25a4309dc714a3c57ad82da8b31d6c (diff)
downloadhercules-c69e4b6cf853d31f18ef9c2f04d2bc965f4ad158.tar.gz
hercules-c69e4b6cf853d31f18ef9c2f04d2bc965f4ad158.tar.bz2
hercules-c69e4b6cf853d31f18ef9c2f04d2bc965f4ad158.tar.xz
hercules-c69e4b6cf853d31f18ef9c2f04d2bc965f4ad158.zip
Fix Bug # 7049
Added new item bonuses bFixedCast, bVariableCast & bFixedCastrate. (see 'doc/item_bonus.txt' for info) Added new conf for max walk path.(Bug Report # 7042) http://hercules.ws/board/tracker/issue-7049-do-we-need-new-bonus/?gopid=16578#entry16578
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index e901d3138..fca406e5f 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -315,21 +315,22 @@ int unit_walktoxy( struct block_list *bl, short x, short y, int flag)
{
struct unit_data* ud = NULL;
struct status_change* sc = NULL;
-#ifdef OFFICIAL_WALKPATH
struct walkpath_data wpd;
-#endif
+
nullpo_ret(bl);
ud = unit_bl2ud(bl);
if( ud == NULL) return 0;
-#ifdef OFFICIAL_WALKPATH
path_search(&wpd, bl->m, bl->x, bl->y, x, y, flag&1, CELL_CHKNOPASS); // Count walk path cells
+#ifdef OFFICIAL_WALKPATH
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
+ if( battle_config.max_walk_path < wpd.path_len )
+ return 0;
if (flag&4 && DIFF_TICK(ud->canmove_tick, gettick()) > 0 &&
DIFF_TICK(ud->canmove_tick, gettick()) < 2000)