summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index e7232a0f9..d217dcf69 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -525,8 +525,8 @@ int mob_spawn_guardian(struct map_session_data *sd,char *mapname,
* Reachability to a Specification ID existence place
* state indicates type of 'seek' mob should do:
* - MSS_LOOT: Looking for item, path must be easy.
- * - MSS_RUSH: Chasing attacking player, path is determined by mob_ai&1
- * - MSS_FOLLOW: Initiative/support seek, path must be easy.
+ * - MSS_RUSH: Chasing attacking player, path is complex
+ * - MSS_FOLLOW: Initiative/support seek, path is complex
*------------------------------------------
*/
int mob_can_reach(struct mob_data *md,struct block_list *bl,int range, int state)
@@ -537,10 +537,10 @@ int mob_can_reach(struct mob_data *md,struct block_list *bl,int range, int state
nullpo_retr(0, bl);
switch (state) {
case MSS_RUSH:
- easy = (battle_config.mob_ai&1?0:1);
+ case MSS_FOLLOW:
+ easy = 0; //(battle_config.mob_ai&1?0:1);
break;
case MSS_LOOT:
- case MSS_FOLLOW:
default:
easy = 1;
break;
@@ -785,7 +785,8 @@ static int mob_ai_sub_hard_activesearch(struct block_list *bl,va_list ap)
if (!(battle_config.mob_ai&128) && (*target) && (*target)->type == BL_HOM && bl->type != BL_HOM)
return 0; //For some reason Homun targets are never overriden.
- if((dist=distance_bl(&md->bl, bl)) < md->db->range2 &&
+ dist = distance_bl(&md->bl, bl);
+ if(dist < md->db->range2 &&
((*target) == NULL || !check_distance_bl(&md->bl, *target, dist)) &&
battle_check_range(&md->bl,bl,md->db->range2)
) { //Pick closest target?
@@ -1215,14 +1216,14 @@ static int mob_ai_sub_hard(struct block_list *bl,va_list ap)
md->state.skillstate = md->state.aggressive?MSS_FOLLOW:MSS_RUSH;
if (md->ud.walktimer != -1 && md->ud.target == tbl->id &&
(
- !battle_config.mob_ai&1 ||
+ !(battle_config.mob_ai&1) ||
check_distance_blxy(tbl, md->ud.to_x, md->ud.to_y, md->status.rhw.range)
)) //Current target tile is still within attack range.
return 0;
//Follow up
if (!mob_can_reach(md, tbl, md->min_chase, MSS_RUSH) ||
- !unit_walktobl(&md->bl, tbl, md->status.rhw.range, 2|(!battle_config.mob_ai&1)))
+ !unit_walktobl(&md->bl, tbl, md->status.rhw.range, 2))
//Give up.
mob_unlocktarget(md,tick);
return 0;