*Update zone for players after adding to map. - by VladimirMangos

*Skip instance loading for player with flypath/on transport.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-08-03 19:48:28 +02:00
parent 044b8b44a3
commit 08cd876f36
3 changed files with 11 additions and 8 deletions

View File

@@ -66,6 +66,7 @@ void WorldSession::HandleMoveWorldportAckOpcode()
GetPlayer()->SetSemaphoreTeleportFar(false);
Map * oldMap = GetPlayer()->GetMap();
// relocate the player to the teleport destination
Map * newMap = MapManager::Instance().CreateMap(loc.mapid, GetPlayer(), 0);
// the CanEnter checks are done in TeleporTo but conditions may change
@@ -86,6 +87,8 @@ void WorldSession::HandleMoveWorldportAckOpcode()
if(!GetPlayer()->GetMap()->Add(GetPlayer()))
{
sLog.outError("WORLD: failed to teleport player %s (%d) to map %d because of unknown reason!", GetPlayer()->GetName(), GetPlayer()->GetGUIDLow(), loc.mapid);
GetPlayer()->ResetMap();
GetPlayer()->SetMap(oldMap);
GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->GetOrientation());
return;
}