Skip to content

Commit

Permalink
Merge pull request liyunfan1223#450 from liyunfan1223/fix_gear_quality2
Browse files Browse the repository at this point in the history
Fix itemQuality for random bots
  • Loading branch information
liyunfan1223 authored Aug 8, 2024
2 parents 5a4d460 + 84e6f6e commit c0836c2
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/PlayerbotFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ PlayerbotFactory::PlayerbotFactory(Player* bot, uint32 level, uint32 itemQuality
: level(level), itemQuality(itemQuality), gearScoreLimit(gearScoreLimit), bot(bot)
{
botAI = GET_PLAYERBOT_AI(bot);
if (!this->itemQuality)
{
uint32 gs = sPlayerbotAIConfig->randomGearScoreLimit == 0
? 0
: PlayerbotFactory::CalcMixedGearScore(sPlayerbotAIConfig->randomGearScoreLimit,
sPlayerbotAIConfig->randomGearQualityLimit);
this->itemQuality = sPlayerbotAIConfig->randomGearQualityLimit;
this->gearScoreLimit = gs;
}
}

void PlayerbotFactory::Init()
Expand Down Expand Up @@ -149,16 +158,6 @@ void PlayerbotFactory::Init()

void PlayerbotFactory::Prepare()
{
if (!itemQuality)
{
uint32 gs = sPlayerbotAIConfig->randomGearScoreLimit == 0
? 0
: PlayerbotFactory::CalcMixedGearScore(sPlayerbotAIConfig->randomGearScoreLimit,
sPlayerbotAIConfig->randomGearQualityLimit);
itemQuality = sPlayerbotAIConfig->randomGearQualityLimit;
gearScoreLimit = gs;
}

if (bot->isDead())
bot->ResurrectPlayer(1.0f, false);

Expand Down

0 comments on commit c0836c2

Please sign in to comment.