From 722abae4909573d25578e543da79634cf0222424 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E4=BD=A9=E8=8C=B9?= Date: Thu, 16 Mar 2023 10:05:43 -0600 Subject: [PATCH] Fix crash when AI is disabled --- src/PlayerbotMgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PlayerbotMgr.cpp b/src/PlayerbotMgr.cpp index a155d0fc..b3505c15 100644 --- a/src/PlayerbotMgr.cpp +++ b/src/PlayerbotMgr.cpp @@ -1112,7 +1112,7 @@ void PlayerbotsMgr::RemovePlayerBotData(ObjectGuid const& guid) PlayerbotAI* PlayerbotsMgr::GetPlayerbotAI(Player* player) { - if (!player || (!player->IsInWorld() && !player->IsBeingTeleported())) + if (!(sPlayerbotAIConfig->enabled) || !player || (!player->IsInWorld() && !player->IsBeingTeleported())) { return nullptr; }