From 290a6bad71cbda683f2dfd346a89dfaaa6f94288 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Sun, 24 Dec 2023 14:59:13 +0800 Subject: [PATCH] Optimize talents initialization --- src/PlayerbotFactory.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/PlayerbotFactory.cpp b/src/PlayerbotFactory.cpp index 10b53bee..752ed6b3 100644 --- a/src/PlayerbotFactory.cpp +++ b/src/PlayerbotFactory.cpp @@ -799,7 +799,9 @@ void PlayerbotFactory::InitTalentsTree(bool increment/*false*/, bool use_templat { uint32 specNo; uint8 cls = bot->getClass(); - if (increment && bot->GetFreeTalentPoints() <= 2) { + std::map tabs = AiFactory::GetPlayerSpecTabs(bot); + uint32 total_tabs = tabs[0] + tabs[1] + tabs[2]; + if (increment && bot->GetFreeTalentPoints() <= 2 && total_tabs != 0) { specNo = AiFactory::GetPlayerSpecTab(bot); } else { uint32 point = urand(0, 100);