summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorskyleo <skyleo@skyleo.de>2019-10-18 23:32:32 +0200
committerskyleo <skyleo@skyleo.de>2019-10-20 17:47:09 +0200
commit78696300e2c09d948407b98d9eac014c882046fe (patch)
tree60676d2a1429257324c18ce53493005fd1370e0d /src/map/unit.c
parent1f6eebe5421534c0d2a29e793ae8ce0328913c7c (diff)
downloadhercules-78696300e2c09d948407b98d9eac014c882046fe.tar.gz
hercules-78696300e2c09d948407b98d9eac014c882046fe.tar.bz2
hercules-78696300e2c09d948407b98d9eac014c882046fe.tar.xz
hercules-78696300e2c09d948407b98d9eac014c882046fe.zip
Fix ud->target_to not being cleared appropriately
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 ) {