diff options
author | wushin <pasekei@gmail.com> | 2015-09-20 12:44:57 -0500 |
---|---|---|
committer | wushin <pasekei@gmail.com> | 2015-09-20 12:44:57 -0500 |
commit | 611030c37917edffe67ea6df114fa65b1b1d6f77 (patch) | |
tree | 345a55e334bf90b82852e85425ea29026f9e8a85 /src/map | |
parent | ce49c4725855137624d854ece6513bd52f5d6122 (diff) | |
download | tmwa-611030c37917edffe67ea6df114fa65b1b1d6f77.tar.gz tmwa-611030c37917edffe67ea6df114fa65b1b1d6f77.tar.bz2 tmwa-611030c37917edffe67ea6df114fa65b1b1d6f77.tar.xz tmwa-611030c37917edffe67ea6df114fa65b1b1d6f77.zip |
Add missing checks
closes #140
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/mob.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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<mob_data> md, dumb_ptr<block_list> 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<block_list> bl, tick_t tick) dumb_ptr<map_session_data> 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<block_list> 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) |