Core/Chat: Allow incorrect spell/skill language assignments to mirror client behavior

Port From (https://github.com/TrinityCore/TrinityCore/commit/14098b28b39bc9d1ea17d18a7ecd3dd610f29cdc)
This commit is contained in:
hondacrx
2021-05-03 22:15:02 -04:00
parent 89633000d1
commit cbb22d291e
10 changed files with 89 additions and 132 deletions
+9 -2
View File
@@ -6334,9 +6334,16 @@ namespace Game.Entities
packet.Initialize(ChatMsg.Whisper, Language.Universal, this, target, Global.DB2Mgr.GetBroadcastTextValue(bct, locale, GetGender()));
target.SendPacket(packet);
}
public bool CanUnderstandLanguageSkillId(uint langSkillId)
public bool CanUnderstandLanguage(Language language)
{
return IsGameMaster() || (langSkillId != 0 && HasSkill((SkillType)langSkillId));
if (IsGameMaster())
return true;
foreach (var languageDesc in Global.LanguageMgr.GetLanguageDescById(language))
if (languageDesc.SkillId != 0 && HasSkill((SkillType)languageDesc.SkillId))
return true;
return false;
}
#endregion