mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Prevent another crash in RandomTeleport
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user