diff options
author | megamage <none@none> | 2009-04-23 21:43:20 -0500 |
---|---|---|
committer | megamage <none@none> | 2009-04-23 21:43:20 -0500 |
commit | 84e9ffb48798f622872a0a5f1e33cd24021b51e0 (patch) | |
tree | f79da25bcdc2de015b955739358e3dfa426ea715 | |
parent | 17056452d78689535b7a264ec371b849828d9300 (diff) |
*Set mover based on client response.
--HG--
branch : trunk
-rw-r--r-- | src/game/MovementHandler.cpp | 15 | ||||
-rw-r--r-- | src/game/Player.cpp | 2 | ||||
-rw-r--r-- | src/game/Vehicle.cpp | 4 |
3 files changed, 11 insertions, 10 deletions
diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index 741ad15b08a..d9c58967150 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -431,13 +431,15 @@ void WorldSession::HandleForceSpeedChangeAck(WorldPacket &recv_data) void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data) { sLog.outDebug("WORLD: Recvd CMSG_SET_ACTIVE_MOVER"); - recv_data.hexlike(); CHECK_PACKET_SIZE(recv_data, 8); uint64 guid; recv_data >> guid; + if(guid == GetPlayer()->m_mover->GetGUID()) + return; + if(Unit *mover = ObjectAccessor::GetUnit(*GetPlayer(), guid)) GetPlayer()->SetMover(mover); else @@ -450,18 +452,17 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data) void WorldSession::HandleMoveNotActiveMover(WorldPacket &recv_data) { sLog.outDebug("WORLD: Recvd CMSG_MOVE_NOT_ACTIVE_MOVER"); - recv_data.hexlike(); CHECK_PACKET_SIZE(recv_data, recv_data.rpos()+8); uint64 old_mover_guid; recv_data >> old_mover_guid; - if(_player->m_mover->GetGUID() == old_mover_guid) + /*if(_player->m_mover->GetGUID() == old_mover_guid) { sLog.outError("HandleMoveNotActiveMover: incorrect mover guid: mover is " I64FMT " and should be " I64FMT " instead of " I64FMT, _player->m_mover->GetGUID(), _player->GetGUID(), old_mover_guid); return; - } + }*/ MovementInfo mi; ReadMovementInfo(recv_data, &mi); @@ -519,10 +520,8 @@ void WorldSession::HandleChangeSeatsOnControlledVehicle(WorldPacket &recv_data) { GetPlayer()->m_Vehicle = vehicle; GetPlayer()->SetClientControl(vehicle, 1); - if(!vehicle->AddPassenger(GetPlayer(), seatNum)) - assert(false); - //WorldPacket data(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0); - //GetPlayer()->GetSession()->SendPacket(&data); + WorldPacket data(SMSG_ON_CANCEL_EXPECTED_RIDE_VEHICLE_AURA, 0); + GetPlayer()->GetSession()->SendPacket(&data); } else if(!vehicle->AddPassenger(GetPlayer(), seatNum)) assert(false); diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 5461857a084..f8f81524f5f 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -19394,6 +19394,8 @@ void Player::SetClientControl(Unit* target, uint8 allowMove) data.append(target->GetPackGUID()); data << uint8(allowMove); GetSession()->SendPacket(&data); + if(target == this) + SetMover(this); } void Player::UpdateZoneDependentAuras( uint32 newZone ) diff --git a/src/game/Vehicle.cpp b/src/game/Vehicle.cpp index f2d023300fe..4ef4781add0 100644 --- a/src/game/Vehicle.cpp +++ b/src/game/Vehicle.cpp @@ -247,7 +247,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatNum) { ((Player*)unit)->SetCharm(this, true); ((Player*)unit)->SetViewpoint(this, true); - ((Player*)unit)->SetMover(this); + //((Player*)unit)->SetMover(this); ((Player*)unit)->VehicleSpellInitialize(); } @@ -286,7 +286,7 @@ void Vehicle::RemovePassenger(Unit *unit) { ((Player*)unit)->SetCharm(this, false); ((Player*)unit)->SetViewpoint(this, false); - ((Player*)unit)->SetMover(unit); + //((Player*)unit)->SetMover(unit); ((Player*)unit)->SendRemoveControlBar(); } |