diff options
author | Haru <haru@dotalux.com> | 2020-04-05 23:45:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-05 23:45:10 +0200 |
commit | 737f8a4280256d36645b3ef3c2f5bbe6f65a757a (patch) | |
tree | ac7f55ec9b485934519ed81a2d4d842baf49db58 /src/map | |
parent | a77dc973845efc6e45c5eea9513f6a161893c201 (diff) | |
parent | 2e5aba2d3594e8739fff86204dd800127050478b (diff) | |
download | hercules-737f8a4280256d36645b3ef3c2f5bbe6f65a757a.tar.gz hercules-737f8a4280256d36645b3ef3c2f5bbe6f65a757a.tar.bz2 hercules-737f8a4280256d36645b3ef3c2f5bbe6f65a757a.tar.xz hercules-737f8a4280256d36645b3ef3c2f5bbe6f65a757a.zip |
Merge pull request #2676 from Kenpachi2k13/del_timer_fix
Fix misplaced return condition in unit_walk_toxy_timer()
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/unit.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/map/unit.c b/src/map/unit.c index 015f755bb..3c0458cd1 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -326,7 +326,7 @@ static int unit_warpto_master(struct block_list *master_bl, struct block_list *s static int unit_walk_toxy_timer(int tid, int64 tick, int id, intptr_t data) { struct block_list *bl = map->id2bl(id); - if (bl == NULL || bl->prev == NULL) // Stop moved because it is missing from the block_list + if (bl == NULL) return 1; struct unit_data *ud = unit->bl2ud(bl); if (ud == NULL) @@ -336,8 +336,12 @@ static int unit_walk_toxy_timer(int tid, int64 tick, int id, intptr_t data) ShowError("unit_walk_timer mismatch %d != %d\n",ud->walktimer,tid); return 1; } + ud->walktimer = INVALID_TIMER; + if (bl->prev == NULL) // Stop moved because it is missing from the block_list. + return 1; + if (ud->walkpath.path_pos >= ud->walkpath.path_len) return 1; |