Core/Movement: Final fix for MSG_MOVE_TELEPORT
* Creator Subv, (thx to Shauren also who stated that this packed should be used when researchs were started) - You all should'be thankful, that bug was a real bitch * Fix creatures using NearTeleportTo (example Urom in Oculus, Skeram/Viscidus in AQ and Heigan in Naxxramas)
This commit is contained in:
@@ -17324,22 +17324,30 @@ void Unit::NearTeleportTo(float x, float y, float z, float orientation, bool cas
|
||||
ToPlayer()->TeleportTo(GetMapId(), x, y, z, orientation, TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET | (casting ? TELE_TO_SPELL : 0));
|
||||
else
|
||||
{
|
||||
UpdatePosition(x, y, z, orientation, true);
|
||||
Position pos; // dummy, not used for creatures.
|
||||
Position pos = {x, y, z, orientation};
|
||||
|
||||
SendTeleportPacket(pos);
|
||||
UpdatePosition(x, y, z, orientation, true);
|
||||
UpdateObjectVisibility();
|
||||
}
|
||||
}
|
||||
|
||||
void Unit::SendTeleportPacket(Position& oldPos)
|
||||
void Unit::SendTeleportPacket(Position& pos)
|
||||
{
|
||||
Position oldPos = {GetPositionX(), GetPositionY(), GetPositionZMinusOffset(), GetOrientation()};
|
||||
if (GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
Relocate(&pos);
|
||||
}
|
||||
WorldPacket data2(MSG_MOVE_TELEPORT, 38);
|
||||
data2.append(GetPackGUID());
|
||||
BuildMovementPacket(&data2);
|
||||
|
||||
|
||||
if (GetTypeId() == TYPEID_UNIT)
|
||||
Relocate(&oldPos);
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
Relocate(&oldPos);
|
||||
|
||||
Relocate(&pos);
|
||||
|
||||
SendMessageToSet(&data2, true);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user