Prevent another crash in RandomTeleport

This commit is contained in:
郑佩茹
2022-03-25 10:43:52 -06:00
parent 0033ae9968
commit e177324a64

View File

@@ -1071,9 +1071,11 @@ void RandomPlayerbotMgr::RandomTeleport(Player* bot, std::vector<WorldLocation>&
}
bot->GetMotionMaster()->Clear();
PlayerbotAI* botAI = GET_PLAYERBOT_AI(bot);
if (botAI)
botAI->Reset();
bot->TeleportTo(loc.GetMapId(), x, y, z, 0);
bot->SendMovementFlagUpdate();
GET_PLAYERBOT_AI(bot)->Reset();
if (pmo)
pmo->finish();