Core/Chat: Fix achievement and enchant link validation

Closes #25367
This commit is contained in:
Shauren
2020-08-31 12:48:25 +02:00
parent 277b401df4
commit 1e8cb1ed1f
2 changed files with 7 additions and 8 deletions

View File

@@ -244,15 +244,14 @@ struct LinkValidator<LinkTags::enchant>
for (uint8 i = 0; i < TOTAL_LOCALES; ++i)
{
std::string_view spellName = info->SpellName[i];
std::string_view skillName = skill->DisplayName[i];
std::string_view spellName = info->SpellName[i];
// alternate form [Skill Name: Spell Name]
return (
(text.length() == (spellName.length() + 2 + skillName.length())) &&
(text.substr(0, spellName.length()) == spellName) &&
(text.substr(spellName.length(), 2) == ": ") &&
(text.substr(spellName.length() + 2) == skillName)
);
if ((text.length() == (skillName.length() + 2 + spellName.length())) &&
(text.substr(0, skillName.length()) == skillName) &&
(text.substr(skillName.length(), 2) == ": ") &&
(text.substr(skillName.length() + 2) == spellName))
return true;
}
}
return false;

View File

@@ -40,7 +40,7 @@ namespace Trinity::Hyperlinks
struct AchievementLinkData
{
AchievementEntry const* Achievement;
ObjectGuid::LowType CharacterId;
ObjectGuid CharacterId;
bool IsFinished;
uint8 Year;
uint8 Month;