1515 * with this program. If not, see <http://www.gnu.org/licenses/>.
1616 */
1717
18- // 1
19- // 2
20- // 3
21- // 4
22- // 5
23- // 6
24- // 7
25- // 8
26- // 9
27- // 10
28-
2918#include "Player.h"
3019#include "AccountMgr.h"
3120#include "AchievementMgr.h"
5039#include "CombatPackets.h"
5140#include "Common.h"
5241#include "ConditionMgr.h"
53- #include "Config.h"
5442#include "Containers.h"
5543#include "CreatureAI.h"
5644#include "DatabaseEnv.h"
@@ -1586,7 +1574,7 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
15861574 // reset movement flags at teleport, because player will continue move with these flags after teleport
15871575 SetUnitMovementFlags(GetUnitMovementFlags() & MOVEMENTFLAG_MASK_HAS_PLAYER_STATUS_OPCODE);
15881576 DisableSpline();
1589- GetMotionMaster()->Remove(EFFECT_MOTION_TYPE );
1577+ GetMotionMaster()->InterruptOnTeleport( );
15901578
15911579 if (Transport* transport = GetTransport())
15921580 {
@@ -1638,13 +1626,15 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
16381626
16391627 // code for finish transfer called in WorldSession::HandleMovementOpcodes()
16401628 // at client packet MSG_MOVE_TELEPORT_ACK
1641- SetSemaphoreTeleportNear(true );
1629+ SetSemaphoreTeleportNear(IsMovedByClient() );
16421630 // near teleport, triggering send MSG_MOVE_TELEPORT_ACK from client at landing
16431631 if (!GetSession()->PlayerLogout())
16441632 {
16451633 SetCanTeleport(true);
16461634 SendTeleportPacket(m_teleport_dest, (options & TELE_TO_TRANSPORT_TELEPORT) != 0);
16471635 }
1636+ if (!IsBeingTeleportedNear()) // update position immediately if we will not be waiting for client ACK
1637+ UpdatePosition(m_teleport_dest, true);
16481638 }
16491639 else
16501640 {
@@ -22533,59 +22523,48 @@ void Player::SendInitialPacketsAfterAddToMap()
2253322523
2253422524 CastSpell(this, 836, true); // LOGINEFFECT
2253522525
22536- // set some aura effects that send packet to player client after add player to map
22537- // SendMessageToSet not send it to player not it map, only for aura that not changed anything at re-apply
22538- // same auras state lost at far teleport, send it one more time in this case also
22539- static const AuraType auratypes[] =
22540- {
22541- SPELL_AURA_MOD_FEAR, SPELL_AURA_TRANSFORM, SPELL_AURA_WATER_WALK,
22542- SPELL_AURA_FEATHER_FALL, SPELL_AURA_HOVER, SPELL_AURA_SAFE_FALL,
22543- SPELL_AURA_FLY, SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED, SPELL_AURA_NONE
22544- };
22545- for (AuraType const* itr = &auratypes[0]; itr && itr[0] != SPELL_AURA_NONE; ++itr)
22546- {
22547- Unit::AuraEffectList const& auraList = GetAuraEffectsByType(*itr);
22548- if (!auraList.empty())
22549- auraList.front()->HandleEffect(this, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, true);
22550- }
22551-
22552- if (HasAuraType(SPELL_AURA_MOD_STUN))
22553- SetRooted(true);
22554-
2255522526 WorldPacket setCompoundState(SMSG_MULTIPLE_MOVES, 100);
2255622527 setCompoundState << uint32(0); // size placeholder
2255722528
2255822529 // manual send package (have code in HandleEffect(this, AURA_EFFECT_HANDLE_SEND_FOR_CLIENT, true); that must not be re-applied.
22559- if (HasAuraType(SPELL_AURA_MOD_ROOT))
22530+ if (HasAuraType(SPELL_AURA_MOD_STUN) || HasAuraType( SPELL_AURA_MOD_ROOT))
2256022531 {
2256122532 setCompoundState << uint8(2 + GetPackGUID().size() + 4);
2256222533 setCompoundState << uint16(SMSG_FORCE_MOVE_ROOT);
2256322534 setCompoundState << GetPackGUID();
22564- setCompoundState << uint32(0); //! movement counter
22535+ setCompoundState << uint32(GetMovementCounterAndInc());
2256522536 }
2256622537
2256722538 if (HasAuraType(SPELL_AURA_FEATHER_FALL))
2256822539 {
2256922540 setCompoundState << uint8(2 + GetPackGUID().size() + 4);
2257022541 setCompoundState << uint16(SMSG_MOVE_FEATHER_FALL);
2257122542 setCompoundState << GetPackGUID();
22572- setCompoundState << uint32(0); //! movement counter0
22543+ setCompoundState << uint32(GetMovementCounterAndInc());
2257322544 }
2257422545
2257522546 if (HasAuraType(SPELL_AURA_WATER_WALK))
2257622547 {
2257722548 setCompoundState << uint8(2 + GetPackGUID().size() + 4);
2257822549 setCompoundState << uint16(SMSG_MOVE_WATER_WALK);
2257922550 setCompoundState << GetPackGUID();
22580- setCompoundState << uint32(0); //! movement counter0
22551+ setCompoundState << uint32(GetMovementCounterAndInc());
2258122552 }
2258222553
2258322554 if (HasAuraType(SPELL_AURA_HOVER))
2258422555 {
2258522556 setCompoundState << uint8(2 + GetPackGUID().size() + 4);
2258622557 setCompoundState << uint16(SMSG_MOVE_SET_HOVER);
2258722558 setCompoundState << GetPackGUID();
22588- setCompoundState << uint32(0); //! movement counter0
22559+ setCompoundState << uint32(GetMovementCounterAndInc());
22560+ }
22561+
22562+ if (HasAuraType(SPELL_AURA_FLY) || HasAuraType(SPELL_AURA_MOD_INCREASE_MOUNTED_FLIGHT_SPEED))
22563+ {
22564+ setCompoundState << uint8(2 + GetPackGUID().size() + 4);
22565+ setCompoundState << uint16(SMSG_MOVE_SET_CAN_FLY);
22566+ setCompoundState << GetPackGUID();
22567+ setCompoundState << uint32(GetMovementCounterAndInc());
2258922568 }
2259022569
2259122570 if (setCompoundState.size() > 4)
@@ -22594,6 +22573,9 @@ void Player::SendInitialPacketsAfterAddToMap()
2259422573 SendDirectMessage(&setCompoundState);
2259522574 }
2259622575
22576+ if (HasUnitState(UNIT_STATE_FLEEING | UNIT_STATE_CONFUSED) || HasAuraType(SPELL_AURA_MOD_CONFUSE) || HasAuraType(SPELL_AURA_MOD_FEAR))
22577+ SetClientControl(this, false);
22578+
2259722579 SendEnchantmentDurations(); // must be after add to map
2259822580 SendItemDurations(); // must be after add to map
2259922581 SendQuestGiverStatusMultiple();
0 commit comments