From 7487995c61911fe2e4c9376fcc44a8dd7bd95163 Mon Sep 17 00:00:00 2001 From: Winfidonarleyan Date: Sat, 23 Oct 2021 02:22:27 +0700 Subject: [PATCH] feat(ProfessionNPC): correct get skill_name --- modules/mod-pvp-mode/src/scripts/ProfessionNpc.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/mod-pvp-mode/src/scripts/ProfessionNpc.cpp b/modules/mod-pvp-mode/src/scripts/ProfessionNpc.cpp index c4a812d..fef4384 100644 --- a/modules/mod-pvp-mode/src/scripts/ProfessionNpc.cpp +++ b/modules/mod-pvp-mode/src/scripts/ProfessionNpc.cpp @@ -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);