From 2e5aba2d3594e8739fff86204dd800127050478b Mon Sep 17 00:00:00 2001 From: Kenpachi Developer Date: Tue, 31 Mar 2020 12:40:49 +0200 Subject: Fix misplaced return condition --- src/map/unit.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/map/unit.c b/src/map/unit.c index a879a125f..b81685a39 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; -- cgit v1.2.3-70-g09d2