[11352] Send SMSG_NEW_WORLD after teleport destination set.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
BThallid 2011-04-14 17:07:26 +04:00 committed by VladimirMangos
parent e605b203e2
commit 919ab70452
2 changed files with 26 additions and 22 deletions

View file

@ -1879,7 +1879,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
if (!GetSession()->PlayerLogout())
{
// send transfer packets
// send transfer packet to display load screen
WorldPacket data(SMSG_TRANSFER_PENDING, (4+4+4));
data << uint32(mapid);
if (m_transport)
@ -1888,26 +1888,6 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
data << uint32(GetMapId());
}
GetSession()->SendPacket(&data);
data.Initialize(SMSG_NEW_WORLD, (20));
if (m_transport)
{
data << uint32(mapid);
data << float(m_movementInfo.GetTransportPos()->x);
data << float(m_movementInfo.GetTransportPos()->y);
data << float(m_movementInfo.GetTransportPos()->z);
data << float(m_movementInfo.GetTransportPos()->o);
}
else
{
data << uint32(mapid);
data << float(x);
data << float(y);
data << float(z);
data << float(orientation);
}
GetSession()->SendPacket( &data );
SendSavedInstances();
}
// remove from old map now
@ -1936,6 +1916,30 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
// move packet sent by client always after far teleport
// code for finish transfer to new map called in WorldSession::HandleMoveWorldportAckOpcode at client packet
SetSemaphoreTeleportFar(true);
if (!GetSession()->PlayerLogout())
{
// transfer finished, inform client to start load
WorldPacket data(SMSG_NEW_WORLD, (20));
data << uint32(mapid);
if (m_transport)
{
data << float(m_movementInfo.GetTransportPos()->x);
data << float(m_movementInfo.GetTransportPos()->y);
data << float(m_movementInfo.GetTransportPos()->z);
data << float(m_movementInfo.GetTransportPos()->o);
}
else
{
data << float(final_x);
data << float(final_y);
data << float(final_z);
data << float(final_o);
}
GetSession()->SendPacket( &data );
SendSavedInstances();
}
}
else
return false;