nullptr fix (#1555)

This commit is contained in:
bash 2025-08-16 15:29:44 +02:00 committed by GitHub
parent 6cb9f56c4e
commit 4f5f7d286e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1028,8 +1028,10 @@ void PlayerbotFactory::ClearSkills()
}
bot->SetUInt32Value(PLAYER_SKILL_INDEX(0), 0);
bot->SetUInt32Value(PLAYER_SKILL_INDEX(1), 0);
// unlearn default race/class skills
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(bot->getRace(), bot->getClass());
if (PlayerInfo const* info = sObjectMgr->GetPlayerInfo(bot->getRace(), bot->getClass()))
{
for (PlayerCreateInfoSkills::const_iterator itr = info->skills.begin(); itr != info->skills.end(); ++itr)
{
uint32 skillId = itr->SkillId;
@ -1038,6 +1040,7 @@ void PlayerbotFactory::ClearSkills()
bot->SetSkill(skillId, 0, 0, 0);
}
}
}
void PlayerbotFactory::ClearEverything()
{