diff --git a/server/gameserver/human.cc b/server/gameserver/human.cc index 4d81bec..6a24b49 100644 --- a/server/gameserver/human.cc +++ b/server/gameserver/human.cc @@ -1791,7 +1791,7 @@ void Human::SelectSkillTargets(const a8::Vec2& target_pos, std::set& ta { for (auto& cell : grid_list) { for (Human* hum : cell->human_list) { - if ((hum == this || hum->team_id == team_id) || + if ((hum == this || hum->team_id == team_id) && hum->pos.Distance(target_pos) < skill_meta->i->skill_distance()) { target_list.insert(hum); } @@ -1803,7 +1803,7 @@ void Human::SelectSkillTargets(const a8::Vec2& target_pos, std::set& ta { for (auto& cell : grid_list) { for (Human* hum : cell->human_list) { - if ((hum != this && hum->team_id == team_id) || + if ((hum != this && hum->team_id == team_id) && hum->pos.Distance(target_pos) < skill_meta->i->skill_distance()) { target_list.insert(hum); } @@ -1826,7 +1826,7 @@ void Human::SelectSkillTargets(const a8::Vec2& target_pos, std::set& ta { for (auto& cell : grid_list) { for (Human* hum : cell->human_list) { - if ((hum->team_id != team_id) || + if ((hum->team_id != team_id) && hum->pos.Distance(target_pos) < skill_meta->i->skill_distance()) { target_list.insert(hum); } @@ -1838,7 +1838,7 @@ void Human::SelectSkillTargets(const a8::Vec2& target_pos, std::set& ta { for (auto& cell : grid_list) { for (Human* hum : cell->human_list) { - if ((hum->team_id != team_id) || + if ((hum->team_id != team_id) && hum->pos.Distance(target_pos) < skill_meta->i->skill_distance()) { target_list.insert(hum); } @@ -1850,7 +1850,7 @@ void Human::SelectSkillTargets(const a8::Vec2& target_pos, std::set& ta { for (auto& cell : grid_list) { for (Human* hum : cell->human_list) { - if ((hum == this || hum->team_id != team_id) || + if ((hum == this || hum->team_id != team_id) && hum->pos.Distance(target_pos) < skill_meta->i->skill_distance()) { target_list.insert(hum); }