[Crash fix] Duplicate bots login

This commit is contained in:
Yunfan Li
2024-07-05 14:17:39 +08:00
parent 98560a1855
commit c63ee90cb2

View File

@@ -363,6 +363,11 @@ Player* PlayerbotHolder::GetPlayerBot(ObjectGuid::LowType lowGuid) const
void PlayerbotHolder::OnBotLogin(Player* const bot)
{
// Prevent duplicate login
if (playerBots.find(bot->GetGUID()) != playerBots.end()) {
return;
}
sPlayerbotsMgr->AddPlayerbotData(bot, true);
playerBots[bot->GetGUID()] = bot;
OnBotLoginInternal(bot);