From 7ea94e7fba12612d7d967c42c9495d2c31fcd6ea Mon Sep 17 00:00:00 2001 From: bo Date: Sun, 22 Mar 2026 14:31:26 -0500 Subject: [PATCH] Fix spec detection for fully-specced bots --- src/modules/Bots/playerbot/AiFactory.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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++; } - } }