summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index d8efcefef..ee9920e4b 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -95,7 +95,7 @@ int unit_walktoxy_sub(struct block_list *bl)
ud = unit->bl2ud(bl);
if(ud == NULL) return 0;
- if( !path_search(&wpd,bl->m,bl->x,bl->y,ud->to_x,ud->to_y,ud->state.walk_easy,CELL_CHKNOPASS) )
+ if( !path->search(&wpd,bl->m,bl->x,bl->y,ud->to_x,ud->to_y,ud->state.walk_easy,CELL_CHKNOPASS) )
return 0;
memcpy(&ud->walkpath,&wpd,sizeof(wpd));
@@ -349,11 +349,11 @@ int unit_walktoxy( struct block_list *bl, short x, short y, int flag)
if( ud == NULL) return 0;
- if (!path_search(&wpd, bl->m, bl->x, bl->y, x, y, flag&1, CELL_CHKNOPASS)) // Count walk path cells
+ if (!path->search(&wpd, bl->m, bl->x, bl->y, x, y, flag&1, CELL_CHKNOPASS)) // Count walk path cells
return 0;
#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
+ 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 > (battle_config.max_walk_path/17)*14) // Official number of walkable cells is 14 if and only if there is an obstacle between. [malufett]
&& (bl->type != BL_NPC) ) // If type is a NPC, please disregard.
return 0;
@@ -645,7 +645,7 @@ int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool
unit->stop_walking(bl,1);
unit->stop_attack(bl);
- if( checkpath && (iMap->getcell(bl->m,dst_x,dst_y,CELL_CHKNOPASS) || !path_search(NULL,bl->m,bl->x,bl->y,dst_x,dst_y,easy,CELL_CHKNOREACH)) )
+ if( checkpath && (iMap->getcell(bl->m,dst_x,dst_y,CELL_CHKNOPASS) || !path->search(NULL,bl->m,bl->x,bl->y,dst_x,dst_y,easy,CELL_CHKNOREACH)) )
return 0; // unreachable
ud->to_x = dst_x;
@@ -679,7 +679,7 @@ int unit_movepos(struct block_list *bl, short dst_x, short dst_y, int easy, bool
{ // Check if pet needs to be teleported. [Skotlex]
int flag = 0;
struct block_list* bl = &sd->pd->bl;
- if( !checkpath && !path_search(NULL,bl->m,bl->x,bl->y,dst_x,dst_y,0,CELL_CHKNOPASS) )
+ if( !checkpath && !path->search(NULL,bl->m,bl->x,bl->y,dst_x,dst_y,0,CELL_CHKNOPASS) )
flag = 1;
else if (!check_distance_bl(&sd->bl, bl, AREA_SIZE)) //Too far, teleport.
flag = 2;
@@ -731,7 +731,7 @@ int unit_blown(struct block_list* bl, int dx, int dy, int count, int flag)
sd = BL_CAST(BL_PC, bl);
su = BL_CAST(BL_SKILL, bl);
- result = path_blownpos(bl->m, bl->x, bl->y, dx, dy, count);
+ result = path->blownpos(bl->m, bl->x, bl->y, dx, dy, count);
nx = result>>16;
ny = result&0xffff;
@@ -775,7 +775,7 @@ int unit_blown(struct block_list* bl, int dx, int dy, int count, int flag)
}
}
- count = distance(dx, dy);
+ count = path->distance(dx, dy);
}
return count; // return amount of knocked back cells
@@ -1703,7 +1703,7 @@ bool unit_can_reach_pos(struct block_list *bl,int x,int y, int easy)
if (bl->x == x && bl->y == y) //Same place
return true;
- return path_search(NULL,bl->m,bl->x,bl->y,x,y,easy,CELL_CHKNOREACH);
+ return path->search(NULL,bl->m,bl->x,bl->y,x,y,easy,CELL_CHKNOREACH);
}
/*==========================================
@@ -1741,7 +1741,7 @@ bool unit_can_reach_bl(struct block_list *bl,struct block_list *tbl, int range,
if (x) *x = tbl->x-dx;
if (y) *y = tbl->y-dy;
- return path_search(NULL,bl->m,bl->x,bl->y,tbl->x-dx,tbl->y-dy,easy,CELL_CHKNOREACH);
+ return path->search(NULL,bl->m,bl->x,bl->y,tbl->x-dx,tbl->y-dy,easy,CELL_CHKNOREACH);
}
/*==========================================
* Calculates position of Pet/Mercenary/Homunculus/Elemental
@@ -1832,7 +1832,7 @@ int unit_attack_timer_sub(struct block_list* src, int tid, unsigned int tick)
if( iStatus->isdead(src) || iStatus->isdead(target) ||
battle->check_target(src,target,BCT_ENEMY) <= 0 || !iStatus->check_skilluse(src, target, 0, 0)
#ifdef OFFICIAL_WALKPATH
- || !path_search_long(NULL, src->m, src->x, src->y, target->x, target->y, CELL_CHKWALL)
+ || !path->search_long(NULL, src->m, src->x, src->y, target->x, target->y, CELL_CHKWALL)
#endif
)
return 0; // can't attack under these conditions