diff --git a/server/gameserver/netdata.cc b/server/gameserver/netdata.cc index f34db4fa..9dcc341b 100644 --- a/server/gameserver/netdata.cc +++ b/server/gameserver/netdata.cc @@ -900,30 +900,39 @@ void BattleDataContext::GetSkillList(std::vector& skill_list) const mt::Skill* skill1 = mt::Skill::GetById(hero_ability_->hero_meta->skill1list()); const mt::Skill* skill2 = mt::Skill::GetById(hero_ability_->hero_meta->skill2list()); const mt::Skill* skill3 = mt::Skill::GetById(hero_ability_->hero_meta->skill3list()); - if (skill1 && skill2 && skill3 && skill1_lv > 0 && skill2_lv > 0 && skill3_lv > 0) { - if (mt::Skill::GetById(skill1->skill_id() + skill1_lv - 1)) { - skill_list.push_back(skill1->skill_id() + skill1_lv - 1); - } else { - skill_list.push_back(skill1->skill_id()); - } - - //替换翻滚 - if (spec_skill) { - skill_list.push_back(spec_skill->skill_id()); - } else { - if (mt::Skill::GetById(skill2->skill_id() + skill2_lv - 2)) { - skill_list.push_back(skill2->skill_id() + skill2_lv - 2); + if (owner_.Get()->IsHuman()) { + if (skill1 && skill2 && skill3 && skill1_lv > 0 && skill2_lv > 0 && skill3_lv > 0) { + if (mt::Skill::GetById(skill1->skill_id() + skill1_lv - 1)) { + skill_list.push_back(skill1->skill_id() + skill1_lv - 1); } else { - skill_list.push_back(skill2->skill_id()); + skill_list.push_back(skill1->skill_id()); + } + + //替换翻滚 + if (spec_skill) { + skill_list.push_back(spec_skill->skill_id()); + } else { + if (mt::Skill::GetById(skill2->skill_id() + skill2_lv - 2)) { + skill_list.push_back(skill2->skill_id() + skill2_lv - 2); + } else { + skill_list.push_back(skill2->skill_id()); + } + } + + if (mt::Skill::GetById(skill3->skill_id() + skill3_lv - 3)) { + skill_list.push_back(skill3->skill_id() + skill3_lv - 3); + } else { + skill_list.push_back(skill3->skill_id()); + } + + } + } else { + std::vector skills; + for (auto skill_meta : skills) { + if (skill_meta) { + skill_list.push_back(skill_meta->skill_id()); } } - - if (mt::Skill::GetById(skill3->skill_id() + skill3_lv - 3)) { - skill_list.push_back(skill3->skill_id() + skill3_lv - 3); - } else { - skill_list.push_back(skill3->skill_id()); - } - } }