From 0033ae996875d5fbc2e7391450152d4634d62175 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91=E4=BD=A9=E8=8C=B9?= Date: Thu, 24 Mar 2022 13:06:00 -0600 Subject: [PATCH] Fix crash in GetPlayerbotMgr --- src/PlayerbotMgr.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PlayerbotMgr.cpp b/src/PlayerbotMgr.cpp index 97bdb312..63d847c8 100644 --- a/src/PlayerbotMgr.cpp +++ b/src/PlayerbotMgr.cpp @@ -1052,7 +1052,7 @@ void PlayerbotsMgr::RemovePlayerBotData(ObjectGuid const& guid) PlayerbotAI* PlayerbotsMgr::GetPlayerbotAI(Player* player) { - if (!player) + if (!player || !player->IsInWorld()) { return nullptr; } @@ -1068,7 +1068,7 @@ PlayerbotAI* PlayerbotsMgr::GetPlayerbotAI(Player* player) PlayerbotMgr* PlayerbotsMgr::GetPlayerbotMgr(Player* player) { - if (!player) + if (!player || !player->IsInWorld()) { return nullptr; }