summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/battle.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index f82153c37..3b355c3b2 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3257,20 +3257,6 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
if (!agit_flag && md->guardian_data && md->guardian_data->guild_id)
return 0; //Disable guardians/emperiums owned by Guilds on non-woe times.
- if(md->state.killer || !(battle_config.mob_ai&0x400))
- state |= BCT_ENEMY; //By default everyone hates mobs.
- else
- { //Smart enemy criteria.
- if (!md->special_state.ai) { //Normal mobs.
- if (s_bl->type == BL_MOB && !((TBL_MOB*)s_bl)->special_state.ai)
- state |= BCT_PARTY; //Normal mobs with no ai are friends.
- else
- state |= BCT_ENEMY; //However, all else are enemies.
- } else {
- if (s_bl->type == BL_MOB && !((TBL_MOB*)s_bl)->special_state.ai)
- state |= BCT_ENEMY; //Natural enemy for AI mobs are normal mobs.
- }
- }
break;
}
}
@@ -3345,8 +3331,20 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
TBL_MOB*md = (TBL_MOB*)s_bl;
if (!agit_flag && md->guardian_data && md->guardian_data->guild_id)
return 0; //Disable guardians/emperium owned by Guilds on non-woe times.
- if(md->state.killer) // Is on a rampage too :D
- state |= BCT_ENEMY;
+ if(md->state.killer || !(battle_config.mob_ai&0x400))
+ state |= BCT_ENEMY; //By default everyone hates mobs.
+ else
+ { //Smart enemy criteria.
+ if (!md->special_state.ai) { //Normal mobs.
+ if (t_bl->type == BL_MOB && !((TBL_MOB*)t_bl)->special_state.ai)
+ 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_MOB && !((TBL_MOB*)t_bl)->special_state.ai)
+ state |= BCT_ENEMY; //Natural enemy for AI mobs are normal mobs.
+ }
+ }
break;
}
default: