aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Chat/ChatCommands/ChatCommandArgs.cpp5
-rw-r--r--src/server/game/Chat/HyperlinkTags.cpp18
2 files changed, 5 insertions, 18 deletions
diff --git a/src/server/game/Chat/ChatCommands/ChatCommandArgs.cpp b/src/server/game/Chat/ChatCommands/ChatCommandArgs.cpp
index a19f9571d0e..91af31cc41c 100644
--- a/src/server/game/Chat/ChatCommands/ChatCommandArgs.cpp
+++ b/src/server/game/Chat/ChatCommands/ChatCommandArgs.cpp
@@ -100,10 +100,7 @@ struct SpellInfoVisitor
value_type operator()(Hyperlink<enchant> enchant) const { return enchant; };
value_type operator()(Hyperlink<glyph> glyph) const { return operator()(glyph->Glyph->SpellID); };
value_type operator()(Hyperlink<spell> spell) const { return *spell; }
- value_type operator()(Hyperlink<talent> talent) const
- {
- return operator()(talent->Talent->SpellRank[talent->Rank - 1]);
- };
+ value_type operator()(Hyperlink<talent> talent) const { return talent->Spell; };
value_type operator()(Hyperlink<trade> trade) const { return trade->Spell; };
value_type operator()(uint32 spellId) const { return sSpellMgr->GetSpellInfo(spellId); }
diff --git a/src/server/game/Chat/HyperlinkTags.cpp b/src/server/game/Chat/HyperlinkTags.cpp
index 5c343a9abe9..84f1986cd91 100644
--- a/src/server/game/Chat/HyperlinkTags.cpp
+++ b/src/server/game/Chat/HyperlinkTags.cpp
@@ -199,22 +199,12 @@ bool Trinity::Hyperlinks::LinkTags::talent::StoreTo(TalentLinkData& val, std::st
if (rank < -1 || rank >= MAX_TALENT_RANK)
return false;
val.Talent = sTalentStore.LookupEntry(talentId);
- val.Rank = rank+1;
+ val.Rank = rank + 1;
if (!val.Talent)
return false;
- if (val.Rank > 0)
- {
- uint32 const spellId = val.Talent->SpellRank[val.Rank - 1];
- if (!spellId)
- return false;
- val.Spell = sSpellMgr->GetSpellInfo(spellId);
- if (!val.Spell)
- return false;
- }
- else
- {
- val.Spell = nullptr;
- }
+ val.Spell = sSpellMgr->GetSpellInfo(val.Talent->SpellRank[std::max<int32>(rank, 0)]);
+ if (!val.Spell)
+ return false;
return true;
}