Fix keyring for low level bots (#1177)

This commit is contained in:
Yunfan Li
2025-04-08 10:11:07 +08:00
committed by GitHub
parent 2f3f8d565c
commit cd5b15ddc1
3 changed files with 7 additions and 2 deletions

View File

@@ -491,6 +491,7 @@ void PlayerbotFactory::Refresh()
InitSpecialSpells();
InitMounts();
InitKeyring();
InitPotions();
if (bot->GetLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel)
{
ApplyEnchantAndGemsNew();
@@ -4280,6 +4281,9 @@ void PlayerbotFactory::InitKeyring()
if (!bot)
return;
if (bot->GetLevel() < 70)
return;
ReputationMgr& repMgr = bot->GetReputationMgr(); // Reference, use . instead of ->
std::vector<std::pair<uint32, uint32>> keysToCheck;

View File

@@ -140,6 +140,7 @@ public:
void InitKeyring();
void InitReputation();
void InitAttunementQuests();
void InitPotions();
private:
void Prepare();
@@ -159,7 +160,6 @@ private:
void ClearInventory();
void ClearAllItems();
void ResetQuests();
void InitPotions();
std::vector<uint32> GetCurrentGemsCount();
bool CanEquipArmor(ItemTemplate const* proto);

View File

@@ -181,6 +181,7 @@ bool MaintenanceAction::Execute(Event event)
factory.InitMounts();
factory.InitGlyphs(true);
factory.InitKeyring();
factory.InitPotions();
if (bot->GetLevel() >= sPlayerbotAIConfig->minEnchantingBotLevel)
factory.ApplyEnchantAndGemsNew();