fix crash caused by bot logout (maybe)

This commit is contained in:
Yunfan Li
2023-09-04 13:02:32 +08:00
parent bb1ea0c395
commit 9575ca222b
2 changed files with 10 additions and 7 deletions

View File

@@ -231,6 +231,9 @@ void PlayerbotHolder::LogoutPlayerBot(ObjectGuid guid)
WorldSession* botWorldSessionPtr = bot->GetSession();
WorldSession* masterWorldSessionPtr = nullptr;
if (botWorldSessionPtr->isLogingOut())
return;
Player* master = botAI->GetMaster();
if (master)
masterWorldSessionPtr = master->GetSession();