From 919ab704520e10c20a096fcdda726ebfe4f32c39 Mon Sep 17 00:00:00 2001 From: BThallid Date: Thu, 14 Apr 2011 17:07:26 +0400 Subject: [PATCH] [11352] Send SMSG_NEW_WORLD after teleport destination set. Signed-off-by: VladimirMangos --- src/game/Player.cpp | 46 ++++++++++++++++++++++------------------ src/shared/revision_nr.h | 2 +- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 97c8438f1..db4b7e85f 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -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; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index c06014f4f..b3961f9f7 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "11351" + #define REVISION_NR "11352" #endif // __REVISION_NR_H__