This commit is contained in:
aozhiwei 2019-07-19 16:02:41 +08:00
parent b7d9cf732d
commit ccda67f9f7

View File

@ -1791,7 +1791,7 @@ void Human::SelectSkillTargets(const a8::Vec2& target_pos, std::set<Entity*>& 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<Entity*>& 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<Entity*>& 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<Entity*>& 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<Entity*>& 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);
}