From 611030c37917edffe67ea6df114fa65b1b1d6f77 Mon Sep 17 00:00:00 2001 From: wushin Date: Sun, 20 Sep 2015 12:44:57 -0500 Subject: Add missing checks closes #140 --- src/map/mob.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/map') diff --git a/src/map/mob.cpp b/src/map/mob.cpp index 539b547..9019989 100644 --- a/src/map/mob.cpp +++ b/src/map/mob.cpp @@ -1374,7 +1374,7 @@ int mob_target(dumb_ptr md, dumb_ptr bl, int dist) { sd = bl->is_player(); nullpo_retz(sd); - if (sd->invincible_timer || pc_isinvisible(sd)) + if (pc_isdead(sd) || sd->invincible_timer || pc_isinvisible(sd)) return 0; if (!bool(mode & MobMode::BOSS) && race != Race::_insect && race != Race::_demon && sd->state.gangsterparadise) @@ -1800,7 +1800,7 @@ void mob_ai_sub_hard(dumb_ptr bl, tick_t tick) dumb_ptr asd = map_id2sd(md->attacked_id); if (asd) { - if (!asd->invincible_timer && !pc_isinvisible(asd)) + if (!pc_isdead(asd) && !asd->invincible_timer && !pc_isinvisible(asd)) { map_foreachinarea(std::bind(mob_ai_sub_hard_linksearch, ph::_1, md, asd), md->bl_m, @@ -1823,7 +1823,7 @@ void mob_ai_sub_hard(dumb_ptr bl, tick_t tick) if (abl->bl_type == BL::PC) asd = abl->is_player(); if (asd == nullptr || md->bl_m != abl->bl_m || abl->bl_prev == nullptr - || asd->invincible_timer || pc_isinvisible(asd) + || asd->invincible_timer || pc_isinvisible(asd) || pc_isdead(asd) || (dist = distance(md->bl_x, md->bl_y, abl->bl_x, abl->bl_y)) >= 32 || battle_check_target(bl, abl, BCT_ENEMY) == 0) -- cgit v1.2.3-70-g09d2