aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Handlers/NPCHandler.cpp
diff options
context:
space:
mode:
authorAokromes <aokromes@gmail.com>2017-04-16 16:09:40 +0200
committerAokromes <aokromes@gmail.com>2017-04-16 16:09:40 +0200
commit98dc10c58003525e53b9d67b3e833328f3906329 (patch)
treec420090874c69006b02007226b7260b98318bcd5 /src/server/game/Handlers/NPCHandler.cpp
parentd8fdc893ee207851270107c1f16dc548800d7d4a (diff)
Core/Trainers: Fix Multiprofession Trainers
By Malcrom, cherry pick from https://gitlab.com/trinitycore/TrinityCore_434/commit/6fef0d2eb2cf85a631be29885f6c3908038ba4f4
Diffstat (limited to 'src/server/game/Handlers/NPCHandler.cpp')
-rw-r--r--src/server/game/Handlers/NPCHandler.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/server/game/Handlers/NPCHandler.cpp b/src/server/game/Handlers/NPCHandler.cpp
index 53578310324..3b257f238a4 100644
--- a/src/server/game/Handlers/NPCHandler.cpp
+++ b/src/server/game/Handlers/NPCHandler.cpp
@@ -88,13 +88,13 @@ void WorldSession::HandleTrainerListOpcode(WorldPackets::NPC::Hello& packet)
SendTrainerList(packet.Unit);
}
-void WorldSession::SendTrainerList(ObjectGuid guid)
+void WorldSession::SendTrainerList(ObjectGuid guid, uint32 index)
{
std::string str = GetTrinityString(LANG_NPC_TAINER_HELLO);
- SendTrainerList(guid, str);
+ SendTrainerList(guid, str, index);
}
-void WorldSession::SendTrainerList(ObjectGuid guid, const std::string& strTitle)
+void WorldSession::SendTrainerList(ObjectGuid guid, const std::string& strTitle, uint32 index)
{
Creature* unit = GetPlayer()->GetNPCIfCanInteractWith(guid, UNIT_NPC_FLAG_TRAINER);
if (!unit)
@@ -127,6 +127,9 @@ void WorldSession::SendTrainerList(ObjectGuid guid, const std::string& strTitle)
{
TrainerSpell const* tSpell = &itr->second;
++ if (index && tSpell->Index != index)
++ continue;
+
bool valid = true;
for (uint8 i = 0; i < MAX_TRAINERSPELL_ABILITY_REQS; ++i)
{