Resolved issues with rndbots and equipmentPersistence (#778)

* Update PlayerbotFactory.cpp

* Update PlayerbotFactory.cpp

* Added !incremental checks for talent/gear init
This commit is contained in:
avirar 2024-12-19 04:32:01 +11:00 committed by GitHub
parent 570787ff16
commit a1b4681c58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -207,7 +207,10 @@ void PlayerbotFactory::Randomize(bool incremental)
Prepare(); Prepare();
LOG_DEBUG("playerbots", "Resetting player..."); LOG_DEBUG("playerbots", "Resetting player...");
PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Reset"); PerformanceMonitorOperation* pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Reset");
bot->resetTalents(true); if (!sPlayerbotAIConfig->equipmentPersistence || level < sPlayerbotAIConfig->equipmentPersistenceLevel)
{
bot->resetTalents(true);
}
// bot->SaveToDB(false, false); // bot->SaveToDB(false, false);
ClearSkills(); ClearSkills();
// bot->SaveToDB(false, false); // bot->SaveToDB(false, false);
@ -267,7 +270,7 @@ void PlayerbotFactory::Randomize(bool incremental)
pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Talents"); pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Talents");
LOG_DEBUG("playerbots", "Initializing talents..."); LOG_DEBUG("playerbots", "Initializing talents...");
if (!sPlayerbotAIConfig->equipmentPersistence || bot->GetLevel() < sPlayerbotAIConfig->equipmentPersistenceLevel) if (!incremental || !sPlayerbotAIConfig->equipmentPersistence || bot->GetLevel() < sPlayerbotAIConfig->equipmentPersistenceLevel)
{ {
InitTalentsTree(); InitTalentsTree();
} }
@ -302,7 +305,7 @@ void PlayerbotFactory::Randomize(bool incremental)
pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Equip"); pmo = sPerformanceMonitor->start(PERF_MON_RNDBOT, "PlayerbotFactory_Equip");
LOG_DEBUG("playerbots", "Initializing equipmemt..."); LOG_DEBUG("playerbots", "Initializing equipmemt...");
if (!sPlayerbotAIConfig->equipmentPersistence || bot->GetLevel() < sPlayerbotAIConfig->equipmentPersistenceLevel) if (!incremental || !sPlayerbotAIConfig->equipmentPersistence || bot->GetLevel() < sPlayerbotAIConfig->equipmentPersistenceLevel)
{ {
InitEquipment(incremental, incremental ? false : sPlayerbotAIConfig->twoRoundsGearInit); InitEquipment(incremental, incremental ? false : sPlayerbotAIConfig->twoRoundsGearInit);
} }