Fix crash when AI is disabled

This commit is contained in:
郑佩茹
2023-03-16 10:05:43 -06:00
parent 0b81c0c7e6
commit 722abae490

View File

@@ -1112,7 +1112,7 @@ void PlayerbotsMgr::RemovePlayerBotData(ObjectGuid const& guid)
PlayerbotAI* PlayerbotsMgr::GetPlayerbotAI(Player* player) PlayerbotAI* PlayerbotsMgr::GetPlayerbotAI(Player* player)
{ {
if (!player || (!player->IsInWorld() && !player->IsBeingTeleported())) if (!(sPlayerbotAIConfig->enabled) || !player || (!player->IsInWorld() && !player->IsBeingTeleported()))
{ {
return nullptr; return nullptr;
} }