Fix getting AI during teleport

This commit is contained in:
郑佩茹
2022-03-25 14:00:52 -06:00
parent 246b5b021d
commit 9797dd0371

View File

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