summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenpachi Developer <Kenpachi.Developer@gmx.de>2020-03-21 04:27:08 +0100
committerKenpachi Developer <Kenpachi.Developer@gmx.de>2020-03-21 04:27:08 +0100
commite6936d2db256d0feffc858f88ce170b2b766eddd (patch)
tree12743f47df226f847d10659ff001167cc9e2da63
parented5d2d7222401f17f9c8ded96ff0e86aba8e88d6 (diff)
downloadhercules-e6936d2db256d0feffc858f88ce170b2b766eddd.tar.gz
hercules-e6936d2db256d0feffc858f88ce170b2b766eddd.tar.bz2
hercules-e6936d2db256d0feffc858f88ce170b2b766eddd.tar.xz
hercules-e6936d2db256d0feffc858f88ce170b2b766eddd.zip
Move misplaced condition in unit_walktobl() function
-rw-r--r--src/map/unit.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index dd644d8d1..a879a125f 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -728,10 +728,13 @@ static int unit_walktobl(struct block_list *bl, struct block_list *tbl, int rang
if(!unit->can_move(bl))
return 0;
- if (unit->walk_toxy_sub(bl) == 0 && (flag & 2) != 0) {
- set_mobstate(bl);
+ if (unit->walk_toxy_sub(bl) == 0) {
+ if ((flag & 2) != 0)
+ set_mobstate(bl);
+
return 1;
}
+
return 0;
}