diff options
Diffstat (limited to 'src/server/game/Handlers/NPCHandler.cpp')
-rw-r--r-- | src/server/game/Handlers/NPCHandler.cpp | 9 |
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) { |