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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index 45cb7dffd..f527b3b00 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -459,10 +459,10 @@ static int unit_walktoxy_timer(int tid, int64 tick, int id, intptr_t data)
}
if (tbl->m == bl->m && check_distance_bl(bl, tbl, ud->chaserange)) {
//Reached destination.
+ ud->target_to = 0;
if (ud->state.attack_continue) {
//Aegis uses one before every attack, we should
//only need this one for syncing purposes. [Skotlex]
- ud->target_to = 0;
clif->fixpos(bl);
unit->attack(bl, tbl->id, ud->state.attack_continue);
}
@@ -544,6 +544,8 @@ static int unit_walktoxy(struct block_list *bl, short x, short y, int flag)
ud->to_x = x;
ud->to_y = y;
unit->stop_attack(bl); //Sets target to 0
+ if ((flag & 8) == 0) // Stepaction might be delayed due to occupied cell
+ unit->stop_stepaction(bl); // unit->walktoxy removes any remembered stepaction and resets ud->target_to
sc = status->get_sc(bl);
if( sc ) {