From 568e52a485fc19a5c2a2de48d8f6fdf2739ebde6 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 19 Mar 2021 16:15:05 +0800 Subject: [PATCH] 1 --- server/gameserver/creature.cc | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/server/gameserver/creature.cc b/server/gameserver/creature.cc index f161f7b..ccde94a 100644 --- a/server/gameserver/creature.cc +++ b/server/gameserver/creature.cc @@ -309,14 +309,12 @@ void Creature::SelectSkillTargets(Skill* skill, const a8::Vec2& target_pos, std: target_list.insert(this); TouchAllLayerHumanList ( - [this, &target_pos, &target_list] (Human* hum, bool& stop) + [this, skill, &target_pos, &target_list] (Human* hum, bool& stop) { -#if 0 if ((hum == this || hum->team_id == team_id) && hum->GetPos().Distance(target_pos) < skill->meta->i->skill_distance()) { target_list.insert(hum); } -#endif }); } break; @@ -324,42 +322,38 @@ void Creature::SelectSkillTargets(Skill* skill, const a8::Vec2& target_pos, std: { TouchAllLayerHumanList ( - [this, &target_pos, &target_list] (Human* hum, bool& stop) + [this, skill, &target_pos, &target_list] (Human* hum, bool& stop) { - #if 0 if ((hum != this && hum->team_id == team_id) && - hum->GetPos().Distance(target_pos) < skill->i->skill_distance()) { + hum->GetPos().Distance(target_pos) < skill->meta->i->skill_distance()) { target_list.insert(hum); } - #endif }); } break; case kST_EnemySingle: { + #if 0 Entity* entity = room->GetEntityByUniId(skill_target_id_); if (entity && entity->IsEntityType(ET_Player)) { Human* hum = (Human*)entity; - #if 0 if (IsEnemy(hum)) { target_list.insert(hum); } - #endif } + #endif } break; case kST_EnemyGroup: { TouchAllLayerHumanList ( - [this, &target_pos, &target_list] (Human* hum, bool& stop) + [this, skill, &target_pos, &target_list] (Human* hum, bool& stop) { - #if 0 if ((hum->team_id != team_id) && - hum->GetPos().Distance(target_pos) < skill->i->skill_distance()) { + hum->GetPos().Distance(target_pos) < skill->meta->i->skill_distance()) { target_list.insert(hum); } - #endif }); } break; @@ -367,14 +361,12 @@ void Creature::SelectSkillTargets(Skill* skill, const a8::Vec2& target_pos, std: { TouchAllLayerHumanList ( - [this, &target_pos, &target_list] (Human* hum, bool& stop) + [this, skill, &target_pos, &target_list] (Human* hum, bool& stop) { - #if 0 if ((hum->team_id != team_id) && - hum->GetPos().Distance(target_pos) < skill->i->skill_distance()) { + hum->GetPos().Distance(target_pos) < skill->meta->i->skill_distance()) { target_list.insert(hum); } - #endif }); } break; @@ -382,14 +374,12 @@ void Creature::SelectSkillTargets(Skill* skill, const a8::Vec2& target_pos, std: { TouchAllLayerHumanList ( - [this, &target_pos, &target_list] (Human* hum, bool& stop) + [this, skill, &target_pos, &target_list] (Human* hum, bool& stop) { - #if 0 if ((hum == this || this->IsEnemy(hum)) && - hum->GetPos().Distance(target_pos) < skill->i->skill_distance()) { + hum->GetPos().Distance(target_pos) < skill->meta->i->skill_distance()) { target_list.insert(hum); } - #endif }); } break;