From 38108320a6ab0a27d9deba967f553b2a6f8b9537 Mon Sep 17 00:00:00 2001 From: skyleo Date: Thu, 3 Oct 2019 00:15:13 +0200 Subject: Update Coding Style for set_mobstate --- src/map/unit.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/map/unit.c') 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) -- cgit v1.2.3-60-g2f50