diff options
author | Trista <aconstantgoal@abv.bg> | 2012-12-24 18:04:58 +0200 |
---|---|---|
committer | Trista <aconstantgoal@abv.bg> | 2012-12-24 18:04:58 +0200 |
commit | 7092e9350bbb8123de688be0bf5dd87d8196d34f (patch) | |
tree | e560819138830c0ad5bfba2f23450d8d8f3eb201 /src | |
parent | f6f368099521dd6c5fee86b54e0bbafb056438fd (diff) |
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)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index 86b0e60e294..2b956f028c7 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -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); } |