Core/Players: Fixed naked bug for players, original idea by BThallid

This commit is contained in:
Shauren
2011-03-19 14:49:15 +01:00
parent 31b9951f20
commit e864b0a611
+14 -11
View File
@@ -2260,22 +2260,12 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
if (!GetSession()->PlayerLogout()) if (!GetSession()->PlayerLogout())
{ {
// send transfer packets // send transfer packets
WorldPacket data(SMSG_TRANSFER_PENDING, (4+4+4)); WorldPacket data(SMSG_TRANSFER_PENDING, 4 + 4 + 4);
data << uint32(mapid); data << uint32(mapid);
if (m_transport) if (m_transport)
{
data << m_transport->GetEntry() << GetMapId(); data << m_transport->GetEntry() << GetMapId();
}
GetSession()->SendPacket(&data);
data.Initialize(SMSG_NEW_WORLD, (20));
if (m_transport)
data << (uint32)mapid << m_movementInfo.t_pos.PositionXYZOStream();
else
data << (uint32)mapid << (float)x << (float)y << (float)z << (float)orientation;
GetSession()->SendPacket(&data); GetSession()->SendPacket(&data);
SendSavedInstances();
} }
// remove from old map now // remove from old map now
@@ -2301,6 +2291,19 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
// if the player is saved before worldportack (at logout for example) // if the player is saved before worldportack (at logout for example)
// this will be used instead of the current location in SaveToDB // this will be used instead of the current location in SaveToDB
if (!GetSession()->PlayerLogout())
{
WorldPacket data(SMSG_NEW_WORLD, 4 + 4 + 4 + 4 + 4);
data << uint32(mapid);
if (m_transport)
data << m_movementInfo.t_pos.PositionXYZOStream();
else
data << m_teleport_dest.PositionXYZOStream();
GetSession()->SendPacket(&data);
SendSavedInstances();
}
// move packet sent by client always after far teleport // move packet sent by client always after far teleport
// code for finish transfer to new map called in WorldSession::HandleMoveWorldportAckOpcode at client packet // code for finish transfer to new map called in WorldSession::HandleMoveWorldportAckOpcode at client packet
SetSemaphoreTeleportFar(true); SetSemaphoreTeleportFar(true);