mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Chat: Fix tradeskill hyperlinks - embedded GUID is now properly read as base 16 (not 10). Closes #22446.
This commit is contained in:
@@ -135,13 +135,9 @@ bool Trinity::Hyperlinks::LinkTags::trade::StoreTo(TradeskillLinkData& val, char
|
||||
{
|
||||
HyperlinkDataTokenizer t(pos, len);
|
||||
uint32 spellId;
|
||||
uint64 guid;
|
||||
if (!t.TryConsumeTo(spellId))
|
||||
return false;
|
||||
val.Spell = sSpellMgr->GetSpellInfo(spellId);
|
||||
if (!(val.Spell && val.Spell->Effects[0].Effect == SPELL_EFFECT_TRADE_SKILL && t.TryConsumeTo(val.CurValue) &&
|
||||
t.TryConsumeTo(val.MaxValue) && t.TryConsumeTo(guid) && t.TryConsumeTo(val.KnownRecipes) && t.IsEmpty()))
|
||||
return false;
|
||||
val.Owner.Set(guid);
|
||||
return true;
|
||||
return (val.Spell && val.Spell->Effects[0].Effect == SPELL_EFFECT_TRADE_SKILL && t.TryConsumeTo(val.CurValue) &&
|
||||
t.TryConsumeTo(val.MaxValue) && t.TryConsumeTo(val.Owner) && t.TryConsumeTo(val.KnownRecipes) && t.IsEmpty());
|
||||
}
|
||||
|
||||
@@ -121,6 +121,13 @@ namespace LinkTags {
|
||||
catch (...) { return false; }
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool StoreTo(ObjectGuid& val, char const* pos, size_t len)
|
||||
{
|
||||
try { val.Set(std::stoul(std::string(pos, len), nullptr, 16)); }
|
||||
catch (...) { return false; }
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
#define make_base_tag(ltag, type) struct ltag : public base_tag { using value_type = type; static constexpr char const* tag() { return #ltag; } }
|
||||
|
||||
Reference in New Issue
Block a user