summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/map')
-rw-r--r--src/map/mob.c2
-rw-r--r--src/map/skill.c14
2 files changed, 3 insertions, 13 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index e05d8e2b6..9f52cbf7b 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -864,7 +864,7 @@ static int mob_ai_sub_hard_lootsearch(struct block_list *bl,va_list ap)
target= va_arg(ap,struct block_list**);
if((dist=distance_bl(&md->bl, bl)) < md->db->range2 &&
- mob_can_reach(md,bl,dist, MSS_LOOT) &&
+ mob_can_reach(md,bl,dist+1, MSS_LOOT) &&
((*target) == NULL || !check_distance_bl(&md->bl, *target, dist)) //New target closer than previous one.
) {
(*target) = bl;
diff --git a/src/map/skill.c b/src/map/skill.c
index d6b18f158..edf39a2c9 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -7096,18 +7096,8 @@ int skill_unit_onplace_timer(struct skill_unit *src,struct block_list *bl,unsign
sc->data[SC_MAGICPOWER].timer = -1;
}
- if (bl->type == BL_MOB && ss != bl) { /* ƒXƒLƒ‹Žg—p?Œ?‚ÌMOBƒXƒLƒ‹ */
- struct mob_data *md = (struct mob_data *)bl;
- if (!md) return 0;
- if (battle_config.mob_changetarget_byskill == 1) {
- int target = md->target_id;
- if (ss->type == BL_PC)
- md->target_id = ss->id;
- mobskill_use(md, tick, MSC_SKILLUSED|(skillid << 16));
- md->target_id = target;
- } else
- mobskill_use(md, tick, MSC_SKILLUSED|(skillid << 16));
- }
+ if (bl->type == BL_MOB && ss != bl)
+ mobskill_event((TBL_MOB*)bl, ss, tick, MSC_SKILLUSED|(skillid<<16));
return skillid;
}