Core/Movement: Fixed near teleports, big thanks to @Trista who basically figured this out on his own.
This commit is contained in:
1 parent
621a249188
commit
143340b38c
4 files changed
+15
-11
No files matched your search
@@ -17325,10 +17325,23 @@ void Unit::NearTeleportTo(float x, float y, float z, float orientation, bool cas
|
||||
else
|
||||
{
|
||||
UpdatePosition(x, y, z, orientation, true);
|
||||
SendMovementFlagUpdate();
|
||||
Position pos; // dummy, not used for creatures.
|
||||
SendTeleportPacket(pos);
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::SendTeleportPacket(Position& oldPos)
|
||||
{
|
||||
WorldPacket data2(MSG_MOVE_TELEPORT, 38);
|
||||
data2.append(GetPackGUID());
|
||||
BuildMovementPacket(&data2);
|
||||
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
Relocate(&oldPos);
|
||||
|
||||
SendMessageToSet(&data2, false);
|
||||
}
|
||||
|
||||
bool Unit::UpdatePosition(float x, float y, float z, float orientation, bool teleport)
|
||||
{
|
||||
// prevent crash when a bad coord is sent by the client
|
||||
|
||||
Reference in new issue
Block a user