From 9d6904f03d67e6feddcbd77f9d74cd4f3b9c38ad Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 2 Jan 2014 14:20:05 +0100 Subject: Core/Vehicles * Fixed vehicle orientation on transports * Fixed exiting vehicles on moving transports --- src/server/game/Entities/Object/Object.cpp | 5 ++++- src/server/game/Entities/Vehicle/Vehicle.cpp | 9 +++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/server/game/Entities/Object/Object.cpp b/src/server/game/Entities/Object/Object.cpp index f18c6fdd977..8af48f277bd 100644 --- a/src/server/game/Entities/Object/Object.cpp +++ b/src/server/game/Entities/Object/Object.cpp @@ -480,7 +480,10 @@ void Object::BuildMovementUpdate(ByteBuffer* data, uint16 flags) const { /// @todo Allow players to aquire this updateflag. *data << uint32(unit->GetVehicleKit()->GetVehicleInfo()->m_ID); - *data << float(unit->GetOrientation()); + if (unit->HasUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT)) + *data << float(unit->GetTransOffsetO()); + else + *data << float(unit->GetOrientation()); } // 0x200 diff --git a/src/server/game/Entities/Vehicle/Vehicle.cpp b/src/server/game/Entities/Vehicle/Vehicle.cpp index a48f46191ba..fae4f0c6b6a 100755 --- a/src/server/game/Entities/Vehicle/Vehicle.cpp +++ b/src/server/game/Entities/Vehicle/Vehicle.cpp @@ -521,8 +521,13 @@ Vehicle* Vehicle::RemovePassenger(Unit* unit) if (_me->IsInWorld()) { - unit->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); - unit->m_movementInfo.transport.Reset(); + if (!_me->GetTransport()) + { + unit->RemoveUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT); + unit->m_movementInfo.transport.Reset(); + } + else + unit->m_movementInfo.transport = _me->m_movementInfo.transport; } // only for flyable vehicles -- cgit v1.2.3