Worldbuff startup fix (#951)

* - [Performance] Fixed world buff loading from config file

* - [Refactoring] Changed mathod name
This commit is contained in:
kadeshar
2025-02-08 12:31:06 +01:00
committed by GitHub
parent db33cecf36
commit 08008a3155
2 changed files with 8 additions and 6 deletions

View File

@@ -419,14 +419,15 @@ bool PlayerbotAIConfig::Initialize()
{
for (uint32 classId = 0; classId < MAX_CLASSES; classId++)
{
for (uint32 specId = 0; specId < MAX_SPECNO; specId++)
for (uint32 specId = 0; specId <= MAX_WORLDBUFF_SPECNO; specId++)
{
for (uint32 minLevel = 0; minLevel < MAX_LEVEL; minLevel++)
for (uint32 minLevel = 0; minLevel <= randomBotMaxLevel; minLevel++)
{
for (uint32 maxLevel = 0; maxLevel < MAX_LEVEL; maxLevel++)
for (uint32 maxLevel = minLevel; maxLevel <= randomBotMaxLevel; maxLevel++)
{
loadWorldBuf(factionId, classId, specId, minLevel, maxLevel);
loadWorldBuff(factionId, classId, specId, minLevel, maxLevel);
}
loadWorldBuff(factionId, classId, specId, minLevel, 0);
}
}
}
@@ -673,7 +674,7 @@ void PlayerbotAIConfig::log(std::string const fileName, char const* str, ...)
fflush(stdout);
}
void PlayerbotAIConfig::loadWorldBuf(uint32 factionId1, uint32 classId1, uint32 specId1, uint32 minLevel1, uint32 maxLevel1)
void PlayerbotAIConfig::loadWorldBuff(uint32 factionId1, uint32 classId1, uint32 specId1, uint32 minLevel1, uint32 maxLevel1)
{
std::vector<uint32> buffs;