summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorHercules.ws <Hercules@efficiently.awesome>2014-11-03 11:47:00 +0100
committerHerculesWSAPI <Hercules@efficiently.awesome>2014-11-03 11:47:00 +0100
commit092949e0fea0c103c7d3fb32953182781853f575 (patch)
tree1fca8313e38d695f8f933e2519e69c28eb0eadec /src/map/unit.c
parentb8abf962fd079bc3cad4498aa968f2318d1f5fde (diff)
downloadhercules-092949e0fea0c103c7d3fb32953182781853f575.tar.gz
hercules-092949e0fea0c103c7d3fb32953182781853f575.tar.bz2
hercules-092949e0fea0c103c7d3fb32953182781853f575.tar.xz
hercules-092949e0fea0c103c7d3fb32953182781853f575.zip
HPM Hooks Update
Signed-off-by: HerculesWSAPI <Hercules@efficiently.awesome>
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index f7b484e0c..044d7a43c 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -440,14 +440,14 @@ int unit_walktoxy_timer(int tid, int64 tick, int id, intptr_t data) {
ud->to_x = bl->x;
ud->to_y = bl->y;
- if(map->count_oncell(bl->m, x, y, BL_CHAR|BL_NPC, 1) > battle_config.official_cell_stack_limit) {
- //Walked on occupied cell, call unit_walktoxy again
- if(ud->steptimer != INVALID_TIMER) {
- //Execute step timer on next step instead
- timer->delete(ud->steptimer, unit_step_timer);
- ud->steptimer = INVALID_TIMER;
- }
- return unit->walktoxy(bl, x, y, 8);
+ if(map->count_oncell(bl->m, x, y, BL_CHAR|BL_NPC, 1) > battle_config.official_cell_stack_limit) {
+ //Walked on occupied cell, call unit_walktoxy again
+ if(ud->steptimer != INVALID_TIMER) {
+ //Execute step timer on next step instead
+ timer->delete(ud->steptimer, unit_step_timer);
+ ud->steptimer = INVALID_TIMER;
+ }
+ return unit->walktoxy(bl, x, y, 8);
}
}
return 0;
@@ -479,7 +479,7 @@ int unit_walktoxy( struct block_list *bl, short x, short y, int flag)
if( ud == NULL) return 0;
- if ((flag&8) && !map->closest_freecell(bl->m, &x, &y, BL_CHAR|BL_NPC, 1)) //This might change x and y
+ if ((flag&8) && !map->closest_freecell(bl->m, &x, &y, BL_CHAR|BL_NPC, 1)) //This might change x and y
return 0;
if (!path->search(&wpd, bl->m, bl->x, bl->y, x, y, flag&1, CELL_CHKNOPASS)) // Count walk path cells
@@ -1853,7 +1853,7 @@ int unit_attack(struct block_list *src,int target_id,int continuous) {
unit->unattackable(src);
return 1;
}
- ud->state.attack_continue = (continuous&1)?1:0;
+ ud->state.attack_continue = (continuous&1)?1:0;
ud->state.step_attack = (continuous&2)?1:0;
unit->set_target(ud, target_id);
@@ -2080,7 +2080,7 @@ int unit_attack_timer_sub(struct block_list* src, int tid, int64 tick) {
sstatus = status->get_status_data(src);
range = sstatus->rhw.range;
- if( (unit_is_walking(target) || ud->state.step_attack)
+ if( (unit_is_walking(target) || ud->state.step_attack)
&& (target->type == BL_PC || !map->getcell(target->m,target->x,target->y,CELL_CHKICEWALL)) )
range++; // Extra range when chasing (does not apply to mobs locked in an icewall)