diff --git a/src/modules/Bots/playerbot/AiFactory.cpp b/src/modules/Bots/playerbot/AiFactory.cpp index 132e6291e..2b89cbf35 100644 --- a/src/modules/Bots/playerbot/AiFactory.cpp +++ b/src/modules/Bots/playerbot/AiFactory.cpp @@ -78,8 +78,14 @@ map AiFactory::GetPlayerSpecTabs(Player* bot) } uint32 classMask = bot->getClassMask(); - for (uint32 i = 0; i < sTalentStore.GetNumRows() && bot->GetFreeTalentPoints(); ++i) + uint32 spentPoints = bot->getLevel() >= 10 ? (bot->getLevel() - 9) - bot->GetFreeTalentPoints() : 0; + uint32 found = 0; + + for (uint32 i = 0; i < sTalentStore.GetNumRows(); ++i) { + if (found >= spentPoints) + break; + TalentEntry const *talentInfo = sTalentStore.LookupEntry(i); if (!talentInfo) { @@ -108,8 +114,8 @@ map AiFactory::GetPlayerSpecTabs(Player* bot) if (spellid && bot->HasSpell(spellid)) { tabs[talentTabInfo->tabpage]++; + found++; } - } }