From da2b73ddd0507e923fa500fea2e3727d04963c30 Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Thu, 18 Jul 2024 00:14:04 +0800 Subject: [PATCH] [Summon] Fix bot remove from world casued by summon --- src/PlayerbotAI.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/PlayerbotAI.cpp b/src/PlayerbotAI.cpp index 4e90e020..71235156 100644 --- a/src/PlayerbotAI.cpp +++ b/src/PlayerbotAI.cpp @@ -451,11 +451,15 @@ void PlayerbotAI::HandleTeleportAck() bot->GetMotionMaster()->Clear(true); bot->StopMoving(); if (bot->IsBeingTeleportedNear()) { + // Temporary fix for instance can not enter + if (!bot->IsInWorld()) { + bot->GetMap()->AddPlayerToMap(bot); + } while (bot->IsInWorld() && bot->IsBeingTeleportedNear()) { Player* plMover = bot->m_mover->ToPlayer(); if (!plMover) return; - WorldPacket p = WorldPacket(MSG_MOVE_TELEPORT_ACK, 8 + 4 + 4); + WorldPacket p = WorldPacket(MSG_MOVE_TELEPORT_ACK, 20); p << plMover->GetPackGUID(); p << (uint32) 0; // supposed to be flags? not used currently p << (uint32) 0; // time - not currently used