Merge pull request #162 from AlvinZhu/PR2

Fix crash when sPlayerbotAIConfig is disabled
This commit is contained in:
ZhengPeiRu21
2023-03-06 23:09:59 -07:00
committed by GitHub

View File

@@ -1128,7 +1128,7 @@ PlayerbotAI* PlayerbotsMgr::GetPlayerbotAI(Player* player)
PlayerbotMgr* PlayerbotsMgr::GetPlayerbotMgr(Player* player) PlayerbotMgr* PlayerbotsMgr::GetPlayerbotMgr(Player* player)
{ {
if (!player || (!player->IsInWorld() && !player->IsBeingTeleported())) if (!(sPlayerbotAIConfig->enabled) || !player || (!player->IsInWorld() && !player->IsBeingTeleported()))
{ {
return nullptr; return nullptr;
} }