diff options
author | silverice <none@none> | 2010-04-04 03:46:38 +0300 |
---|---|---|
committer | silverice <none@none> | 2010-04-04 03:46:38 +0300 |
commit | 5dfcccdd85691c79e93af7555eafc55214d0471e (patch) | |
tree | e91f144e0ec4f0610c6b2c14ccde7b99dc30eb47 /src/game/MovementHandler.cpp | |
parent | 917193eda513d762260a9e4fd4904f00ff407caf (diff) |
correct movement packet broadcasting
mover should be source of movement packets, not player
resolves problem that movements of controlled unit not visible for nearby players
(you can detect it only when controlled unit too far from player-controller)
--HG--
branch : trunk
Diffstat (limited to 'src/game/MovementHandler.cpp')
-rw-r--r-- | src/game/MovementHandler.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index 03ad6bf6e63..f138b42c486 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -349,7 +349,7 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data ) movementInfo.time = getMSTime(); movementInfo.guid = mover->GetGUID(); WriteMovementInfo(&data, &movementInfo); - GetPlayer()->SendMessageToSet(&data, false); + mover->SendMessageToSet(&data, _player); mover->m_movementInfo = movementInfo; @@ -360,9 +360,10 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data ) return; } + mover->SetPosition(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o); + if (plMover) // nothing is charmed, or player charmed { - plMover->SetPosition(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o); plMover->UpdateFallInformationIfNeed(movementInfo, opcode); if (movementInfo.z < -500.0f) @@ -396,17 +397,15 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data ) } } } - else // creature charmed + /*else // creature charmed { - mover->SetPosition(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o); - - /*if(mover->canFly()) + if(mover->canFly()) { bool flying = mover->IsFlying(); if(flying != ((mover->GetByteValue(UNIT_FIELD_BYTES_1, 3) & 0x02) ? true : false)) mover->SetFlying(flying); - }*/ - } + } + }*/ //sLog.outString("Receive Movement Packet %s:", opcodeTable[recv_data.GetOpcode()]); //mover->OutMovementInfo(); |