From 72cab37bcc434afd3dcae83acba14380cf0a94cb Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 31 May 2009 16:24:56 -0500 Subject: [7923] Search all available locale skill names in .learn all_recipes Author: VladimirMangos --HG-- branch : trunk --- src/game/Level2.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/game/Level2.cpp b/src/game/Level2.cpp index 70baff4f42e..31834fce8ea 100644 --- a/src/game/Level2.cpp +++ b/src/game/Level2.cpp @@ -3971,6 +3971,7 @@ bool ChatHandler::HandleLearnAllRecipesCommand(const char* args) wstrToLower( wnamepart ); uint32 classmask = m_session->GetPlayer()->getClassMask(); + std::string name; SkillLineEntry const *targetSkillInfo = NULL; @@ -3987,8 +3988,27 @@ bool ChatHandler::HandleLearnAllRecipesCommand(const char* args) int loc = GetSessionDbcLocale(); name = skillInfo->name[loc]; + if(name.empty()) + continue; + + if (!Utf8FitTo(name, wnamepart)) + { + loc = 0; + for(; loc < MAX_LOCALE; ++loc) + { + if(loc==GetSessionDbcLocale()) + continue; + + name = skillInfo->name[loc]; + if(name.empty()) + continue; + + if (Utf8FitTo(name, wnamepart)) + break; + } + } - if(Utf8FitTo(name, wnamepart)) + if(loc < MAX_LOCALE) { targetSkillInfo = skillInfo; break; -- cgit v1.2.3