diff options
author | Kenpachi Developer <Kenpachi.Developer@gmx.de> | 2020-03-31 12:40:49 +0200 |
---|---|---|
committer | Kenpachi Developer <Kenpachi.Developer@gmx.de> | 2020-03-31 12:40:49 +0200 |
commit | 2e5aba2d3594e8739fff86204dd800127050478b (patch) | |
tree | aaf429f003b9ec9c48889d6926715297ce87ff6e /src | |
parent | dd7f653b00239299cdecb7ca826c21e5957863da (diff) | |
download | hercules-2e5aba2d3594e8739fff86204dd800127050478b.tar.gz hercules-2e5aba2d3594e8739fff86204dd800127050478b.tar.bz2 hercules-2e5aba2d3594e8739fff86204dd800127050478b.tar.xz hercules-2e5aba2d3594e8739fff86204dd800127050478b.zip |
Fix misplaced return condition
Diffstat (limited to 'src')
-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 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; |