summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/map/unit.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/map/unit.c b/src/map/unit.c
index 37a211ba1..5d3011aba 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -605,10 +605,14 @@ static int unit_walktoxy(struct block_list *bl, short x, short y, int flag)
*/
static inline void set_mobstate(struct block_list *bl, int flag)
{
- struct mob_data* md = BL_CAST(BL_MOB,bl);
+ struct mob_data* md = BL_CAST(BL_MOB, bl);
- if( md && flag )
- md->state.skillstate = md->state.aggressive ? MSS_FOLLOW : MSS_RUSH;
+ if (md != NULL && flag != 0) {
+ if (md->state.aggressive != 0)
+ md->state.skillstate = MSS_FOLLOW;
+ else
+ md->state.skillstate = MSS_RUSH;
+ }
}
static int unit_walktobl_sub(int tid, int64 tick, int id, intptr_t data)