diff options
author | Peter Keresztes Schmidt <carbenium@outlook.com> | 2020-08-17 18:26:41 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-02-02 21:08:29 +0100 |
commit | 1c246cc980d2cdb96bab55dd64fccfd46cfd33e7 (patch) | |
tree | 23913226c708df3e36c550787bef1eb5a958df0f | |
parent | c8b0d4e6d83faa3476756fde1f16c72e876ab990 (diff) |
Core/ChatCommands: Parse SpellInfo also from enchant, glyph, talent and trade links (PR #25270)
(cherry picked from commit 9df61fd111a39983d751ac0bed767137b330c547)
-rw-r--r-- | src/server/game/Chat/ChatCommands/ChatCommandArgs.cpp | 11 | ||||
-rw-r--r-- | src/server/game/Chat/Hyperlinks.h | 16 |
2 files changed, 18 insertions, 9 deletions
diff --git a/src/server/game/Chat/ChatCommands/ChatCommandArgs.cpp b/src/server/game/Chat/ChatCommands/ChatCommandArgs.cpp index 45c3011241a..9f62839d612 100644 --- a/src/server/game/Chat/ChatCommands/ChatCommandArgs.cpp +++ b/src/server/game/Chat/ChatCommands/ChatCommandArgs.cpp @@ -68,12 +68,21 @@ char const* Trinity::ChatCommands::ArgInfo<GameTele const*>::TryConsume(GameTele struct SpellInfoVisitor { using value_type = SpellInfo const*; + + value_type operator()(Hyperlink<apower> artifactPower) const { return operator()(artifactPower->ArtifactPower->SpellID); } + value_type operator()(Hyperlink<conduit> soulbindConduit) const { return operator()((*soulbindConduit)->SpellID); } + value_type operator()(Hyperlink<enchant> enchant) const { return enchant; } + value_type operator()(Hyperlink<mawpower> mawPower) const { return operator()((*mawPower)->SpellID); } + value_type operator()(Hyperlink<pvptal> pvpTalent) const { return operator()((*pvpTalent)->SpellID); } value_type operator()(Hyperlink<spell> spell) const { return spell->Spell; } + value_type operator()(Hyperlink<talent> talent) const { return operator()((*talent)->SpellID); } + value_type operator()(Hyperlink<trade> trade) const { return trade->Spell; } + value_type operator()(uint32 spellId) const { return sSpellMgr->GetSpellInfo(spellId, DIFFICULTY_NONE); } }; char const* Trinity::ChatCommands::ArgInfo<SpellInfo const*>::TryConsume(SpellInfo const*& data, char const* args) { - Variant<Hyperlink<spell>, uint32> val; + Variant<Hyperlink<apower>, Hyperlink<conduit>, Hyperlink<enchant>, Hyperlink<mawpower>, Hyperlink<pvptal>, Hyperlink<spell>, Hyperlink<talent>, Hyperlink<trade>, uint32> val; if ((args = CommandArgsConsumerSingle<decltype(val)>::TryConsumeTo(val, args))) data = val.visit(SpellInfoVisitor()); return args; diff --git a/src/server/game/Chat/Hyperlinks.h b/src/server/game/Chat/Hyperlinks.h index ababb840938..4754763b531 100644 --- a/src/server/game/Chat/Hyperlinks.h +++ b/src/server/game/Chat/Hyperlinks.h @@ -293,7 +293,7 @@ namespace Trinity::Hyperlinks struct TC_GAME_API conduit { - using value_type = SoulbindConduitRankEntry const*&; + using value_type = SoulbindConduitRankEntry const*; static constexpr char const* tag() { return "conduit"; } static bool StoreTo(SoulbindConduitRankEntry const*& val, char const* pos, size_t len); }; @@ -321,7 +321,7 @@ namespace Trinity::Hyperlinks struct TC_GAME_API garrfollowerability { - using value_type = GarrAbilityEntry const*&; + using value_type = GarrAbilityEntry const*; static constexpr char const* tag() { return "garrfollowerability"; } static bool StoreTo(GarrAbilityEntry const*& val, char const* pos, size_t len); }; @@ -363,14 +363,14 @@ namespace Trinity::Hyperlinks struct TC_GAME_API mawpower { - using value_type = MawPowerEntry const*&; + using value_type = MawPowerEntry const*; static constexpr char const* tag() { return "mawpower"; } static bool StoreTo(MawPowerEntry const*& val, char const* pos, size_t len); }; struct TC_GAME_API pvptal { - using value_type = PvpTalentEntry const*&; + using value_type = PvpTalentEntry const*; static constexpr char const* tag() { return "pvptal"; } static bool StoreTo(PvpTalentEntry const*& val, char const* pos, size_t len); }; @@ -391,7 +391,7 @@ namespace Trinity::Hyperlinks struct TC_GAME_API talent { - using value_type = TalentEntry const*&; + using value_type = TalentEntry const*; static constexpr char const* tag() { return "talent"; } static bool StoreTo(TalentEntry const*& val, char const* pos, size_t len); }; @@ -405,21 +405,21 @@ namespace Trinity::Hyperlinks struct TC_GAME_API transmogappearance { - using value_type = ItemModifiedAppearanceEntry const*&; + using value_type = ItemModifiedAppearanceEntry const*; static constexpr char const* tag() { return "transmogappearance"; } static bool StoreTo(ItemModifiedAppearanceEntry const*& val, char const* pos, size_t len); }; struct TC_GAME_API transmogillusion { - using value_type = SpellItemEnchantmentEntry const*&; + using value_type = SpellItemEnchantmentEntry const*; static constexpr char const* tag() { return "transmogillusion"; } static bool StoreTo(SpellItemEnchantmentEntry const*& val, char const* pos, size_t len); }; struct TC_GAME_API transmogset { - using value_type = TransmogSetEntry const*&; + using value_type = TransmogSetEntry const*; static constexpr char const* tag() { return "transmogset"; } static bool StoreTo(TransmogSetEntry const*& val, char const* pos, size_t len); }; |