diff options
author | skyleo <skyleo@skyleo.de> | 2019-10-03 00:15:13 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2020-03-08 20:56:28 +0100 |
commit | 38108320a6ab0a27d9deba967f553b2a6f8b9537 (patch) | |
tree | 737d2a47ab7a2b7ec78d99fdba376dceaf6b1b21 | |
parent | 349f811ab9921e5e2d91411f822b9b6c916a60f7 (diff) | |
download | hercules-38108320a6ab0a27d9deba967f553b2a6f8b9537.tar.gz hercules-38108320a6ab0a27d9deba967f553b2a6f8b9537.tar.bz2 hercules-38108320a6ab0a27d9deba967f553b2a6f8b9537.tar.xz hercules-38108320a6ab0a27d9deba967f553b2a6f8b9537.zip |
Update Coding Style for set_mobstate
-rw-r--r-- | src/map/unit.c | 10 |
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) |