From ccda67f9f73a20b21a940b085b2c556306e4b8ea Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 19 Jul 2019 16:02:41 +0800 Subject: [PATCH] 1 --- server/gameserver/human.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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); }