feat(ProfessionNPC): correct get skill_name

This commit is contained in:
Winfidonarleyan
2021-10-23 02:22:27 +07:00
parent 2898ce9a80
commit 7487995c61

View File

@@ -81,15 +81,14 @@ class Professions_NPC : public CreatureScript
bool LearnAllRecipesInProfession(Player *pPlayer, SkillType skill)
{
ChatHandler handler(pPlayer->GetSession());
char* skill_name;
SkillLineEntry const *SkillInfo = sSkillLineStore.LookupEntry(skill);
skill_name = SkillInfo->name[handler.GetSessionDbcLocale()];
auto skill_name = SkillInfo->name[handler.GetSessionDbcLocale()];
if (!SkillInfo)
{
sLog->outError("Profession NPC: received non-valid skill ID (LearnAllRecipesInProfession)");
return false;
sLog->outError("Profession NPC: received non-valid skill ID (LearnAllRecipesInProfession)");
return false;
}
LearnSkillRecipesHelper(pPlayer, SkillInfo->id);