Core/Vehicles: Improved vehicle passenger position calculation (still not complete)

This commit is contained in:
Shauren committed 2012-09-09 19:56:00 +02:00
1 parent 97a92036d1
commit 83817afd99
8 files changed
+68 -33

No files matched your search

+9 -9
View File
@@ -406,15 +406,8 @@ void Unit::UpdateSplineMovement(uint32 t_diff)
pos.m_positionZ = loc.z;
pos.m_orientation = loc.orientation;
if (Unit* vehicle = GetVehicleBase())
{
loc.x += vehicle->GetPositionX();
loc.y += vehicle->GetPositionY();
loc.z += vehicle->GetPositionZMinusOffset();
loc.orientation = vehicle->GetOrientation();
}
else if (Transport* trans = GetTransport())
trans->CalculatePassengerPosition(loc.x, loc.y, loc.z, loc.orientation);
if (TransportBase* transport = GetDirectTransport())
transport->CalculatePassengerPosition(loc.x, loc.y, loc.z, loc.orientation);
}
UpdatePosition(loc.x, loc.y, loc.z, loc.orientation);
@@ -16289,6 +16282,13 @@ uint64 Unit::GetTransGUID() const
return 0;
}
TransportBase* Unit::GetDirectTransport() const
{
if (Vehicle* veh = GetVehicle())
return veh;
return GetTransport();
}
bool Unit::IsInPartyWith(Unit const* unit) const
{
if (this == unit)