summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-10-16 06:46:57 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-10-16 06:46:57 +0000
commit6669de77431e0bb6548bdcbb13a6cf13f40b247f (patch)
tree5f374064a47b94ad9a7cbb8b3ce08305b7e58327 /src/map/unit.c
parentf87f36b82dbf7f907555fed2fdd8efab8f869ea6 (diff)
downloadhercules-6669de77431e0bb6548bdcbb13a6cf13f40b247f.tar.gz
hercules-6669de77431e0bb6548bdcbb13a6cf13f40b247f.tar.bz2
hercules-6669de77431e0bb6548bdcbb13a6cf13f40b247f.tar.xz
hercules-6669de77431e0bb6548bdcbb13a6cf13f40b247f.zip
* Changed function-like macros into inline functions where it seemed appropriate (topic:264007).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14976 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/unit.c')
-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 09a19e27d..a11b5dc28 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -323,9 +323,13 @@ int unit_walktoxy( struct block_list *bl, short x, short y, int flag)
}
//To set Mob's CHASE/FOLLOW states (shouldn't be done if there's no path to reach)
-#define set_mobstate(bl, flag) \
- if((bl)->type == BL_MOB && (flag)) \
- ((TBL_MOB*)(bl))->state.skillstate = ((TBL_MOB*)(bl))->state.aggressive?MSS_FOLLOW:MSS_RUSH;
+static inline void set_mobstate(struct block_list* bl, int flag)
+{
+ struct mob_data* md = BL_CAST(BL_MOB,bl);
+
+ if( md && flag )
+ md->state.skillstate = md->state.aggressive ? MSS_FOLLOW : MSS_RUSH;
+}
static int unit_walktobl_sub(int tid, unsigned int tick, int id, intptr_t data)
{