diff options
Diffstat (limited to 'src/game/MovementHandler.cpp')
-rw-r--r-- | src/game/MovementHandler.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/game/MovementHandler.cpp b/src/game/MovementHandler.cpp index d4388f3c7a4..def605bc8c7 100644 --- a/src/game/MovementHandler.cpp +++ b/src/game/MovementHandler.cpp @@ -307,7 +307,11 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data ) } if (!mover->GetTransport() && !mover->GetVehicle()) - movementInfo.flags &= ~MOVEMENTFLAG_ONTRANSPORT; + { + GameObject *go = mover->GetMap()->GetGameObject(movementInfo.t_guid); + if (!go || go->GetGoType() != GAMEOBJECT_TYPE_TRANSPORT) + movementInfo.flags &= ~MOVEMENTFLAG_ONTRANSPORT; + } } else if (plMover && plMover->GetTransport()) // if we were on a transport, leave { @@ -354,6 +358,20 @@ void WorldSession::HandleMovementOpcodes( WorldPacket & recv_data ) plMover->SetPosition(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o); plMover->UpdateFallInformationIfNeed(movementInfo, opcode); + // If on vehicle, update carried players + if (Vehicle *vehicle=plMover->GetVehicleKit()) + { + if (plMover->IsVehicle()) + { + for (int i=0; i < 8; ++i) + { + if (Unit *passenger = vehicle->GetPassenger(i)) + if (passenger != NULL && passenger->GetTypeId() == TYPEID_PLAYER) + ((Player*)passenger)->SetPosition(movementInfo.x, movementInfo.y, movementInfo.z, movementInfo.o); + } + } + } + if (movementInfo.z < -500.0f) { if (plMover->InBattleGround() |