Core/Movement: fix player fall under ground on teleport

This commit is contained in:
joschiwald committed 2013-11-21 16:13:13 +01:00
1 parent 0a2a552b5a
commit 82d4ed5615
2 files changed
+7 -2

No files matched your search

@@ -2190,6 +2190,8 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
{
Position oldPos;
GetPosition(&oldPos);
if (HasUnitMovementFlag(MOVEMENTFLAG_HOVER))
z += GetFloatValue(UNIT_FIELD_HOVERHEIGHT);
Relocate(x, y, z, orientation);
SendTeleportAckPacket();
SendTeleportPacket(oldPos); // this automatically relocates to oldPos in order to broadcast the packet in the right place
+5 -2
View File
@@ -83,8 +83,11 @@ void WorldSession::HandleMoveWorldportAckOpcode()
GetPlayer()->TeleportTo(GetPlayer()->m_homebindMapId, GetPlayer()->m_homebindX, GetPlayer()->m_homebindY, GetPlayer()->m_homebindZ, GetPlayer()->GetOrientation());
return;
}
else
GetPlayer()->Relocate(&loc);
float z = loc.GetPositionZ();
if (GetPlayer()->HasUnitMovementFlag(MOVEMENTFLAG_HOVER))
z += GetPlayer()->GetFloatValue(UNIT_FIELD_HOVERHEIGHT);
GetPlayer()->Relocate(loc.GetPositionX(), loc.GetPositionY(), z, loc.GetOrientation());
GetPlayer()->ResetMap();
GetPlayer()->SetMap(newMap);