summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-03 17:15:09 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-03-03 17:15:09 +0000
commit9d73a996d9edba1da1f36461f3838d5571a781a3 (patch)
treee6475b9724879a8375e46a1269611b004b4eaf3c /src/map/battle.c
parentd214e16b4875f2be40c817f609d940a6ff5ef088 (diff)
downloadhercules-9d73a996d9edba1da1f36461f3838d5571a781a3.tar.gz
hercules-9d73a996d9edba1da1f36461f3838d5571a781a3.tar.bz2
hercules-9d73a996d9edba1da1f36461f3838d5571a781a3.tar.xz
hercules-9d73a996d9edba1da1f36461f3838d5571a781a3.zip
- Added event 8 for mobspawns that should spawn with special ai set.
- Modified battle_check_target so that mobs with special ai's default enemy are mobs with no special ai. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5448 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index f985f69f2..f1d03c062 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3387,8 +3387,10 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
state |= BCT_PARTY; //Normal mobs with no ai are friends.
else
state |= BCT_ENEMY; //However, all else are enemies.
- } else if (t_bl->type != BL_PC)
- state |= BCT_ENEMY; //Natural enemy for AI mobs are nonplayers.
+ } else {
+ if (t_bl->type == BL_MOB && !((struct mob_data*)t_bl)->special_state.ai)
+ state |= BCT_ENEMY; //Natural enemy for AI mobs are normal mobs.
+ }
if (md->master_id && (s_bl = map_id2bl(md->master_id)) == NULL)
s_bl = &md->bl; //Fallback on the mob itself, otherwise consider this a "from master" scenario.
break;