aboutsummaryrefslogtreecommitdiff
path: root/src/game/Player.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Player.cpp')
-rw-r--r--src/game/Player.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index d53d61581c1..25d57128664 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -1640,7 +1640,16 @@ uint8 Player::chatTag() const
return 0;
}
-void Player::SendTeleportAckMsg()
+void Player::SendTeleportPacket(Position &oldPos)
+{
+ WorldPacket data2(MSG_MOVE_TELEPORT, 38);
+ data2.append(GetPackGUID());
+ BuildMovementPacket(&data2);
+ Relocate(&oldPos);
+ SendMessageToSet(&data2, false);
+}
+
+void Player::SendTeleportAckPacket()
{
WorldPacket data(MSG_MOVE_TELEPORT_ACK, 41);
data.append(GetPackGUID());
@@ -1777,8 +1786,8 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
Position oldPos;
GetPosition(&oldPos);
Relocate(x, y, z, orientation);
- SendTeleportAckMsg();
- Relocate(&oldPos);
+ SendTeleportAckPacket();
+ SendTeleportPacket(oldPos); // this automatically relocates to oldPos in order to broadcast the packet in the right place
}
}
else