mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
[Crash fix] Duplicate bots login
This commit is contained in:
@@ -363,6 +363,11 @@ Player* PlayerbotHolder::GetPlayerBot(ObjectGuid::LowType lowGuid) const
|
|||||||
|
|
||||||
void PlayerbotHolder::OnBotLogin(Player* const bot)
|
void PlayerbotHolder::OnBotLogin(Player* const bot)
|
||||||
{
|
{
|
||||||
|
// Prevent duplicate login
|
||||||
|
if (playerBots.find(bot->GetGUID()) != playerBots.end()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
sPlayerbotsMgr->AddPlayerbotData(bot, true);
|
sPlayerbotsMgr->AddPlayerbotData(bot, true);
|
||||||
playerBots[bot->GetGUID()] = bot;
|
playerBots[bot->GetGUID()] = bot;
|
||||||
OnBotLoginInternal(bot);
|
OnBotLoginInternal(bot);
|
||||||
|
|||||||
Reference in New Issue
Block a user