From 78696300e2c09d948407b98d9eac014c882046fe Mon Sep 17 00:00:00 2001 From: skyleo Date: Fri, 18 Oct 2019 23:32:32 +0200 Subject: Fix ud->target_to not being cleared appropriately --- src/map/unit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 ) { -- cgit v1.2.3-60-g2f50