mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-13 03:32:28 -04:00
fix(mcp): Fix same-map teleport and add phase initialization for bot visibility
- Same-map teleport now uses direct Relocate() instead of NearTeleportTo() which expects client ACK that headless sessions can't provide - Add phase initialization (phase 169) so bot players are visible to others
This commit is contained in:
@@ -515,6 +515,10 @@ bool MCPPlayerManager::Login(uint32 sessionId, ObjectGuid playerGuid)
|
||||
session->player->SetMap(map);
|
||||
session->player->UpdatePositionData();
|
||||
|
||||
// Clear any phase restrictions so bot is visible to everyone
|
||||
session->player->GetPhaseShift().Clear();
|
||||
session->player->GetPhaseShift().AddPhase(169, PhaseFlags::None, nullptr); // Default phase
|
||||
|
||||
// Link session to player
|
||||
session->worldSession->SetPlayer(session->player);
|
||||
|
||||
@@ -740,8 +744,11 @@ bool MCPPlayerManager::TeleportTo(uint32 sessionId, uint32 mapId, float x, float
|
||||
|
||||
if (!isCrossMap)
|
||||
{
|
||||
// Same map teleport - simple relocate
|
||||
player->NearTeleportTo(x, y, z, o);
|
||||
// Same map teleport - direct relocate for headless sessions
|
||||
// NearTeleportTo expects client ACK, so we manually relocate
|
||||
player->Relocate(x, y, z, o);
|
||||
player->UpdatePositionData();
|
||||
player->UpdateObjectVisibility();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user