Skip to content

Commit a4da552

Browse files
authored
Merge 7ea94e7 into 050a010
2 parents 050a010 + 7ea94e7 commit a4da552

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/modules/Bots/playerbot/AiFactory.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,14 @@ map<uint32, int32> AiFactory::GetPlayerSpecTabs(Player* bot)
7878
}
7979

8080
uint32 classMask = bot->getClassMask();
81-
for (uint32 i = 0; i < sTalentStore.GetNumRows() && bot->GetFreeTalentPoints(); ++i)
81+
uint32 spentPoints = bot->getLevel() >= 10 ? (bot->getLevel() - 9) - bot->GetFreeTalentPoints() : 0;
82+
uint32 found = 0;
83+
84+
for (uint32 i = 0; i < sTalentStore.GetNumRows(); ++i)
8285
{
86+
if (found >= spentPoints)
87+
break;
88+
8389
TalentEntry const *talentInfo = sTalentStore.LookupEntry(i);
8490
if (!talentInfo)
8591
{
@@ -108,8 +114,8 @@ map<uint32, int32> AiFactory::GetPlayerSpecTabs(Player* bot)
108114
if (spellid && bot->HasSpell(spellid))
109115
{
110116
tabs[talentTabInfo->tabpage]++;
117+
found++;
111118
}
112-
113119
}
114120
}
115121

0 commit comments

Comments
 (0)